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 #3826

Merged
merged 11 commits into from Jan 9, 2020
@@ -880,21 +880,19 @@ impl Tile {
// Invalidate the tile based on the content changing.
self.update_content_validity(ctx, state);

// TODO(gw): This is a hack / temporary bug fix. With the recent changes
// to treat native surfaces as an entire surface, we need to
// skip the optimization that drops empty tiles within the
// surface area. This has some unfortunate performance implications
// in some cases, so we'll need a proper fix for this, but this
// should fix correctness for now, at least.
match state.composite_state.compositor_kind {
CompositorKind::Draw { .. } => {
// If there are no primitives there is no need to draw or cache it.
if self.current_descriptor.prims.is_empty() {
return false;
// If there are no primitives there is no need to draw or cache it.
if self.current_descriptor.prims.is_empty() {
// If there is a native compositor surface allocated for this (now empty) tile
// it must be freed here, otherwise the stale tile with previous contents will
// be composited. If the tile subsequently gets new primitives added to it, the
// surface will be re-allocated when it's added to the composite draw list.
if let Some(TileSurface::Texture { descriptor: SurfaceTextureDescriptor::Native { mut id, .. }, .. }) = self.surface.take() {
if let Some(id) = id.take() {
state.resource_cache.destroy_compositor_tile(id);
}
}
CompositorKind::Native { .. } => {
}

return false;
}

// Check if this tile can be considered opaque. Opacity state must be updated only
@@ -1080,7 +1080,7 @@ impl BrushSegment {
let port = frame_state
.surfaces[surface_index.0]
.render_tasks
.expect(&format!("bug: no task for surface {:?}", surface_index))
.unwrap_or_else(|| panic!("bug: no task for surface {:?}", surface_index))
.port;
frame_state.render_tasks.add_dependency(port, clip_task_id);
ClipMaskKind::Mask(clip_task_id)
@@ -1156,7 +1156,7 @@ impl TextureResolver {
TextureSource::External(external_image) => {
let texture = self.external_images
.get(&(external_image.id, external_image.channel_index))
.expect(&format!("BUG: External image should be resolved by now"));
.expect("BUG: External image should be resolved by now");
device.bind_external_texture(sampler, texture);
Swizzle::default()
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.