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

Avoid redundant frame builds (take two). #3092

Merged
merged 4 commits into from Sep 26, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Proper queueing of external events and sample APZ when building the s…

…cene.
  • Loading branch information
nical committed Sep 20, 2018
commit 1f3661952ff4b96a0f6e482fe54ebc008cd6690d
@@ -206,6 +206,9 @@ impl Document {
};
}
FrameMsg::HitTest(pipeline_id, point, flags, tx) => {
if !self.hit_tester_is_valid {
self.rebuild_hit_tester();
}

let result = match self.hit_tester {
Some(ref hit_tester) => {
@@ -640,6 +643,9 @@ impl RenderBackend {
SceneBuilderResult::FlushComplete(tx) => {
tx.send(()).ok();
}
SceneBuilderResult::ExternalEvent(evt) => {
self.notifier.external_event(evt);
}
SceneBuilderResult::Stopped => {
panic!("We haven't sent a Stop yet, how did we get a Stopped back?");
}
@@ -742,7 +748,7 @@ impl RenderBackend {
).unwrap();
}
ApiMsg::ExternalEvent(evt) => {
self.notifier.external_event(evt);
self.low_priority_scene_tx.send(SceneBuilderRequest::ExternalEvent(evt)).unwrap();
}
ApiMsg::ClearNamespace(namespace_id) => {
self.resource_cache.clear_namespace(namespace_id);
@@ -984,7 +990,7 @@ impl RenderBackend {
// 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 {
if requested_frame || has_built_scene {
if let Some(ref sampler) = self.sampler {
frame_ops.append(&mut sampler.sample());
}
@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use api::{AsyncBlobImageRasterizer, BlobImageRequest, BlobImageParams, BlobImageResult};
use api::{DocumentId, PipelineId, ApiMsg, FrameMsg, ResourceUpdate, Epoch};
use api::{DocumentId, PipelineId, ApiMsg, FrameMsg, ResourceUpdate, ExternalEvent, Epoch};
use api::{BuiltDisplayList, ColorF, LayoutSize, NotificationRequest, Checkpoint};
use api::channel::MsgSender;
#[cfg(feature = "capture")]
@@ -114,6 +114,7 @@ pub struct BuiltScene {
// Message from render backend to scene builder.
pub enum SceneBuilderRequest {
Transaction(Box<Transaction>),
ExternalEvent(ExternalEvent),
DeleteDocument(DocumentId),
WakeUp,
Flush(MsgSender<()>),
@@ -130,6 +131,7 @@ pub enum SceneBuilderRequest {
// Message from scene builder to render backend.
pub enum SceneBuilderResult {
Transaction(Box<BuiltTransaction>, Option<Sender<SceneSwapResult>>),
ExternalEvent(ExternalEvent),
FlushComplete(MsgSender<()>),
Stopped,
}
@@ -226,6 +228,10 @@ impl SceneBuilder {
Ok(SceneBuilderRequest::SaveScene(config)) => {
self.save_scene(config);
}
Ok(SceneBuilderRequest::ExternalEvent(evt)) => {
self.tx.send(SceneBuilderResult::ExternalEvent(evt)).unwrap();
self.api_tx.send(ApiMsg::WakeUp).unwrap();
}
Ok(SceneBuilderRequest::Stop) => {
self.tx.send(SceneBuilderResult::Stopped).unwrap();
// We don't need to send a WakeUp to api_tx because we only
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.