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

Sync changes from mozilla-central gfx/wr #3856

Merged
merged 9 commits into from Feb 12, 2020
Next

Bug 1600793 - Make the scrolling input telemetry work for WebRender r…

  • Loading branch information
sefeng211 authored and moz-gfx committed Feb 11, 2020
commit 4d7547fdd0d29c5c08683da7d41743c8b3a19e2a
@@ -217,6 +217,7 @@ pub use crate::renderer::{
RendererStats, SceneBuilderHooks, ThreadListener, ShaderPrecacheFlags,
MAX_VERTEX_TEXTURE_WIDTH,
};
pub use crate::internal_types::FastHashMap;
pub use crate::screen_capture::{AsyncScreenshotHandle, RecordedFrameHandle};
pub use crate::shade::{Shaders, WrShaders};
pub use api as webrender_api;
@@ -1481,19 +1481,20 @@ impl RenderBackend {
) {
let requested_frame = render_frame;

let requires_frame_build = self.requires_frame_build();
let doc = self.documents.get_mut(&document_id).unwrap();
// If we have a sampler, get more frame ops from it and add them
// to the transaction. This is a hook to allow the WR user code to
// fiddle with things after a potentially long scene build, but just
// before rendering. This is useful for rendering with the latest
// async transforms.
if requested_frame || has_built_scene {
if let Some(ref sampler) = self.sampler {
frame_ops.append(&mut sampler.sample(document_id));
frame_ops.append(&mut sampler.sample(document_id,
&doc.scene.pipeline_epochs));
}
}

let requires_frame_build = self.requires_frame_build();
let doc = self.documents.get_mut(&document_id).unwrap();
doc.has_built_scene |= has_built_scene;

// If there are any additions or removals of clip modes
@@ -6186,7 +6186,8 @@ pub trait AsyncPropertySampler {
/// This is called for each transaction with the generate_frame flag set
/// (i.e. that will trigger a render). The list of frame messages returned
/// are processed as though they were part of the original transaction.
fn sample(&self, document_id: DocumentId) -> Vec<FrameMsg>;
fn sample(&self, document_id: DocumentId,
doc: &FastHashMap<PipelineId, Epoch>) -> Vec<FrameMsg>;
/// This is called exactly once, when the render backend thread is about to
/// terminate.
fn deregister(&self);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.