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
Next

Bug 1606685 - Support empty tiles within compositor surfaces. r=sotaro

This adds support for holes within virtual surfaces. On platforms
that don't use virtual surfaces, this just works by destroying
the tile that is empty so it never gets composited.

Differential Revision: https://phabricator.services.mozilla.com/D59059

[wrupdater] From https://hg.mozilla.org/mozilla-central/rev/e9d191b5eb8a78b117f55c0dd6993cb0d136c7c8
  • Loading branch information
Glenn Watson authored and moz-gfx committed Jan 8, 2020
commit 9316c47e27f0b4141da19249deaf5270bd1ff027
@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.