Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async scene building. #2362

Merged
merged 18 commits into from Feb 22, 2018
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Handle removed pipelines.

  • Loading branch information
nical committed Feb 21, 2018
commit c8ee8586e9ee836e3f5bd729498f8369abdfbfb3
@@ -27,6 +27,7 @@ use renderer::PipelineInfo;
use render_backend::{SceneRequest, BuiltScene};

use std::sync::Arc;

This comment has been minimized.

@mrobinson

mrobinson Feb 20, 2018

Member

This should probably go with the rest of the use statements.

use std::mem::replace;

#[derive(Copy, Clone, PartialEq, PartialOrd, Debug, Eq, Ord)]
#[cfg_attr(feature = "capture", derive(Serialize))]
@@ -1175,9 +1176,9 @@ impl FrameContext {
// This will soon replace the method above and move somewhere else.
pub fn create_frame_builder_async(
config: &FrameBuilderConfig,
request: SceneRequest,
mut request: SceneRequest,
) -> BuiltScene {
let scene = &request.scene;
let scene = &mut request.scene;
let inner_rect = request.view.inner_rect;
let window_size = request.view.window_size;
let device_pixel_scale = request.view.accumulated_scale_factor();
@@ -1246,6 +1247,7 @@ impl FrameContext {
frame_builder,
clip_scroll_tree,
pipeline_epoch_map,
removed_pipelines: replace(&mut scene.removed_pipelines, Vec::new()),
document_id: request.document_id,
render: request.render,
}
@@ -566,9 +566,10 @@ impl RenderBackend {
loop {
profile_scope!("handle_msg");

while let Ok(msg) = self.scene_rx.try_recv() {
while let Ok(mut msg) = self.scene_rx.try_recv() {
if let Some(doc) = self.documents.get_mut(&msg.document_id) {
doc.frame_builder = Some(msg.frame_builder);
doc.removed_pipelines.extend(msg.removed_pipelines.drain(..));
doc.frame_ctx.new_async_scene_ready(
msg.clip_scroll_tree,
msg.pipeline_epoch_map,
@@ -1154,6 +1155,7 @@ pub struct BuiltScene {
pub frame_builder: FrameBuilder,
pub clip_scroll_tree: ClipScrollTree,
pub pipeline_epoch_map: FastHashMap<PipelineId, Epoch>,
pub removed_pipelines: Vec<PipelineId>,
pub document_id: DocumentId,
pub render: bool,
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.