mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit4d10d39e8f
, reversing changes made toee94e2b7c0
.
This commit is contained in:
parent
4d10d39e8f
commit
676f2c8acf
54 changed files with 3154 additions and 1426 deletions
|
@ -70,8 +70,8 @@ use bluetooth_traits::BluetoothRequest;
|
|||
use browsingcontext::{BrowsingContext, SessionHistoryChange, SessionHistoryEntry};
|
||||
use browsingcontext::{FullyActiveBrowsingContextsIterator, AllBrowsingContextsIterator};
|
||||
use canvas::canvas_paint_thread::CanvasPaintThread;
|
||||
use canvas::webgl_paint_thread::WebGLPaintThread;
|
||||
use canvas_traits::CanvasMsg;
|
||||
use canvas::webgl_thread::WebGLThreads;
|
||||
use canvas_traits::canvas::CanvasMsg;
|
||||
use clipboard::{ClipboardContext, ClipboardProvider};
|
||||
use compositing::SendableFrameTree;
|
||||
use compositing::compositor_thread::CompositorProxy;
|
||||
|
@ -96,7 +96,6 @@ use net_traits::pub_domains::reg_host;
|
|||
use net_traits::request::RequestInit;
|
||||
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||
use network_listener::NetworkListener;
|
||||
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
||||
use pipeline::{InitialPipelineState, Pipeline};
|
||||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
|
@ -298,8 +297,11 @@ pub struct Constellation<Message, LTF, STF> {
|
|||
/// Phantom data that keeps the Rust type system happy.
|
||||
phantom: PhantomData<(Message, LTF, STF)>,
|
||||
|
||||
/// Entry point to create and get channels to a WebGLThread.
|
||||
webgl_threads: WebGLThreads,
|
||||
|
||||
/// A channel through which messages can be sent to the webvr thread.
|
||||
webvr_thread: Option<IpcSender<WebVRMsg>>,
|
||||
webvr_chan: Option<IpcSender<WebVRMsg>>,
|
||||
}
|
||||
|
||||
/// State needed to construct a constellation.
|
||||
|
@ -337,6 +339,12 @@ pub struct InitialConstellationState {
|
|||
/// Webrender API.
|
||||
pub webrender_api_sender: webrender_api::RenderApiSender,
|
||||
|
||||
/// Entry point to create and get channels to a WebGLThread.
|
||||
pub webgl_threads: WebGLThreads,
|
||||
|
||||
/// A channel to the webgl thread.
|
||||
pub webvr_chan: Option<IpcSender<WebVRMsg>>,
|
||||
|
||||
/// Whether the constellation supports the clipboard.
|
||||
/// TODO: this field is not used, remove it?
|
||||
pub supports_clipboard: bool,
|
||||
|
@ -581,7 +589,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
info!("Using seed {} for random pipeline closure.", seed);
|
||||
(rng, prob)
|
||||
}),
|
||||
webvr_thread: None
|
||||
webgl_threads: state.webgl_threads,
|
||||
webvr_chan: state.webvr_chan,
|
||||
};
|
||||
|
||||
constellation.run();
|
||||
|
@ -700,7 +709,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
webrender_api_sender: self.webrender_api_sender.clone(),
|
||||
webrender_document: self.webrender_document,
|
||||
is_private,
|
||||
webvr_thread: self.webvr_thread.clone()
|
||||
webgl_chan: self.webgl_threads.pipeline(),
|
||||
webvr_chan: self.webvr_chan.clone()
|
||||
});
|
||||
|
||||
let pipeline = match result {
|
||||
|
@ -994,10 +1004,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
FromCompositorMsg::LogEntry(top_level_browsing_context_id, thread_name, entry) => {
|
||||
self.handle_log_entry(top_level_browsing_context_id, thread_name, entry);
|
||||
}
|
||||
FromCompositorMsg::SetWebVRThread(webvr_thread) => {
|
||||
assert!(self.webvr_thread.is_none());
|
||||
self.webvr_thread = Some(webvr_thread)
|
||||
}
|
||||
FromCompositorMsg::WebVREvents(pipeline_ids, events) => {
|
||||
debug!("constellation got {:?} WebVR events", events.len());
|
||||
self.handle_webvr_events(pipeline_ids, events);
|
||||
|
@ -1154,10 +1160,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
debug!("constellation got create-canvas-paint-thread message");
|
||||
self.handle_create_canvas_paint_thread_msg(&size, sender)
|
||||
}
|
||||
FromScriptMsg::CreateWebGLPaintThread(size, attributes, sender) => {
|
||||
debug!("constellation got create-WebGL-paint-thread message");
|
||||
self.handle_create_webgl_paint_thread_msg(&size, attributes, sender)
|
||||
}
|
||||
FromScriptMsg::NodeStatus(message) => {
|
||||
debug!("constellation got NodeStatus message");
|
||||
self.compositor_proxy.send(ToCompositorMsg::Status(source_top_ctx_id, message));
|
||||
|
@ -1367,7 +1369,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(chan) = self.webvr_thread.as_ref() {
|
||||
debug!("Exiting WebGL thread.");
|
||||
if let Err(e) = self.webgl_threads.exit() {
|
||||
warn!("Exit WebGL Thread failed ({})", e);
|
||||
}
|
||||
|
||||
if let Some(chan) = self.webvr_chan.as_ref() {
|
||||
debug!("Exiting WebVR thread.");
|
||||
if let Err(e) = chan.send(WebVRMsg::Exit) {
|
||||
warn!("Exit WebVR thread failed ({})", e);
|
||||
|
@ -2135,19 +2142,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_create_webgl_paint_thread_msg(
|
||||
&mut self,
|
||||
size: &Size2D<i32>,
|
||||
attributes: GLContextAttributes,
|
||||
response_sender: IpcSender<Result<(IpcSender<CanvasMsg>, GLLimits), String>>) {
|
||||
let webrender_api = self.webrender_api_sender.clone();
|
||||
let response = WebGLPaintThread::start(*size, attributes, webrender_api);
|
||||
|
||||
if let Err(e) = response_sender.send(response) {
|
||||
warn!("Create WebGL paint thread response failed ({})", e);
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_webdriver_msg(&mut self, msg: WebDriverCommandMsg) {
|
||||
// Find the script channel for the given parent pipeline,
|
||||
// and pass the event to that script thread.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue