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

Merged
merged 33 commits into from Mar 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
240b8ed
Bug 1510030 - Don't return the current opacity value from update_opac…
hiikezoe Feb 27, 2020
0809ea1
Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
hiikezoe Feb 27, 2020
8aa347d
Bug 1510030 - Make prepare_prim_for_render private. r=gw
hiikezoe Feb 27, 2020
b2bc0a8
Bug 1510030 - Implement WebRender backend to run background color ani…
hiikezoe Feb 27, 2020
b0e0510
Backed out 6 changesets (bug 1510030) for webrender bustages CLOSED TREE
bogdantara Feb 27, 2020
8353c5a
Bug 1510030 - Don't return the current opacity value from update_opac…
hiikezoe Feb 27, 2020
6f45b76
Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
hiikezoe Feb 27, 2020
d422aab
Bug 1510030 - Make prepare_prim_for_render private. r=gw
hiikezoe Feb 27, 2020
692bc61
Bug 1510030 - Implement WebRender backend to run background color ani…
hiikezoe Feb 27, 2020
1fc3512
Backed out 6 changesets (bug 1510030) for test_running_on_compositor.…
bogdantara Feb 27, 2020
13e86e2
Bug 1510030 - Don't return the current opacity value from update_opac…
hiikezoe Feb 27, 2020
ecd8232
Bug 1510030 - Fix the comment for OpacityBinding::update(). r=gw
hiikezoe Feb 27, 2020
b152ac5
Bug 1510030 - Make prepare_prim_for_render private. r=gw
hiikezoe Feb 27, 2020
7b1f4fa
Bug 1510030 - Implement WebRender backend to run background color ani…
hiikezoe Feb 27, 2020
1ee6c0f
Bug 1616995 - patch 2 - Support vertical skew for upright-vertical fo…
jfkthame Feb 29, 2020
85ccbbf
Bug 1596513: Part 1: Take scale factors into account when rendering d…
cbrewster Feb 29, 2020
142de92
Bug 1596513: Part 3: Ensure drop shadow blur radius does not exceed M…
cbrewster Feb 29, 2020
6cffb1b
Bug 1579235 - Part 6 - Support an opaque/alpha native surface per sli…
gw3583 Mar 2, 2020
54d5fe8
Bug 1579235 - Part 7 - Fix UV rect calculation for external textures.…
gw3583 Mar 2, 2020
ab7ca3e
Bug 1579235 - Part 8 - Remove overlay tiles, they can be alpha tiles …
gw3583 Mar 2, 2020
49df0ec
Bug 1619265 - Bump rust versions for github CI. r=jrmuizel
staktrace Mar 2, 2020
ad0cd12
Bug 1579235 - Part 9 - Optimize compositor surface overlays. r=Bert
gw3583 Mar 3, 2020
4d776c9
Bug 1613260 - Support per-task scale for local space rasterization r=…
bpeersmoz Mar 3, 2020
517a4b6
Bug 1619293 - Re-enable rust flags in github CI. r=jrmuizel
staktrace Mar 3, 2020
7ed1505
Bug 1613260 - Increase allowed fuzz on new tests so they pass in AppV…
staktrace Mar 4, 2020
bf01196
Bug 1618319: Segregate intern::UpdateList insertions and removals. r=gw
Mar 4, 2020
a1991bc
Bug 1579235 - Part 10 - Fix incorrect skipping of composites. r=Bert
gw3583 Mar 4, 2020
dab8afd
Bug 1619393 - Reftest improvements for fuzzy tests r=gw
bpeersmoz Mar 5, 2020
8d121d8
Bug 1616255 - Handle start and end offsets in conic-gradient WR shade…
nt1m Mar 5, 2020
256215e
Bug 1619393 - Increase fuzz by one to allow reftest to pass on AppVey…
staktrace Mar 6, 2020
5aad73f
Bug 1579235 - Part 11 - Refactor how external surfaces are composited…
gw3583 Mar 6, 2020
4236b41
Bug 1579235 - Part 12 - Support native compositor surfaces. r=Bert,so…
gw3583 Mar 6, 2020
51b4045
Bug 1618939 - Hit MOZ_CRASH(explicit panic) at gfx/wr/webrender/src/r…
bpeersmoz Mar 6, 2020
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Bug 1579235 - Part 8 - Remove overlay tiles, they can be alpha tiles …

…instead. r=nical

A previous patch in this series introduced overlay tiles. However,
now that native surfaces exist for for the opaque and alpha tiles
within a slice, we can remove the overlay tiles array and add
these special tiles to the alpha surface.

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

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/38b7f4761f5041a0e3b2326c2be37f98da509e21
  • Loading branch information
gw3583 authored and moz-gfx committed Mar 2, 2020
commit ab7ca3e1c1e42d9f092f599f56ed2b9ecd10d22d
@@ -71,17 +71,6 @@ pub enum CompositeSurfaceFormat {
Yuv,
}

/// The ordering that this tile should be composited with.
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
#[derive(Debug, Copy, Clone)]
pub enum TileCompositeMode {
/// Normal z-ordering for this tile
Default,
/// This tile overlaps a compositor surface - draw it after them
Over,
}

/// Describes the geometry and surface of a tile to be composited
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
@@ -93,7 +82,6 @@ pub struct CompositeTile {
pub valid_rect: DeviceRect,
pub z_id: ZBufferId,
pub tile_id: Option<NativeTileId>,
pub mode: TileCompositeMode,
}

/// Describes information about drawing a primitive as a compositor surface.
@@ -423,24 +411,6 @@ impl CompositeState {
visible_alpha_tile_count += 1;
}

// Determine ordering of this tile, based on presence of compositor
// surfaces that intersect the tile.
let mut mode = TileCompositeMode::Default;

if tile.has_compositor_surface {
// TODO(gw): This will almost always select over blend, due to the
// background rectangle. In future, we can optimize this
// case to only check items that come _after_ the compositor
// surface z_id? A better option might be to tweak the z_id
// values so that the alpha pixels get z-rejected?
for surface in &tile_cache.external_surfaces {
if surface.device_rect.intersects(&tile.device_valid_rect) {
mode = TileCompositeMode::Over;
break;
}
}
}

let tile = CompositeTile {
surface,
rect: device_rect,
@@ -449,7 +419,6 @@ impl CompositeState {
clip_rect: device_clip_rect,
z_id,
tile_id,
mode,
};

self.push_tile(tile, is_opaque);
@@ -564,19 +533,12 @@ impl CompositeState {
self.clear_tiles.push(tile);
}
CompositeTileSurface::Texture { .. } => {
match tile.mode {
TileCompositeMode::Default => {
// Texture surfaces get bucketed by opaque/alpha, for z-rejection
// on the Draw compositor mode.
if is_opaque {
self.opaque_tiles.push(tile);
} else {
self.alpha_tiles.push(tile);
}
}
TileCompositeMode::Over => {
self.alpha_tiles.push(tile);
}
// Texture surfaces get bucketed by opaque/alpha, for z-rejection
// on the Draw compositor mode.
if is_opaque {
self.opaque_tiles.push(tile);
} else {
self.alpha_tiles.push(tile);
}
}
}
@@ -69,7 +69,7 @@
//! content will all be squashed into a single slice, in order to save GPU memory
//! and compositing performance.
//!
//! ## Overlay Tiles
//! ## Compositor Surfaces
//!
//! Sometimes, a primitive would prefer to exist as a native compositor surface.
//! This allows a large and/or regularly changing primitive (such as a video, or
@@ -79,12 +79,12 @@
//! Since drawing a primitive as a compositor surface alters the ordering of
//! primitives in a tile, we use 'overlay tiles' to ensure correctness. If a
//! tile has a compositor surface, _and_ that tile has primitives that overlap
//! the compositor surface rect, the tile switches to be drawn in overlay mode.
//! the compositor surface rect, the tile switches to be drawn in alpha mode.
//!
//! We rely on only promoting compositor surfaces that are opaque primitives.
//! With this assumption, the tile(s) that intersect the compositor surface get
//! a 'cutout' in the rectangle where the compositor surface exists (not the
//! entire tile), allowing that tile to be drawn as an overlay after the
//! entire tile), allowing that tile to be drawn as an alpha tile after the
//! compositor surface.
//!
//! Tiles are only drawn in overlay mode if there is content that exists on top
@@ -492,6 +492,9 @@ struct TilePostUpdateContext<'a> {

/// The local rect of the overall picture cache
local_rect: PictureRect,

/// A list of the external surfaces that are present on this slice
external_surfaces: &'a [ExternalSurfaceDescriptor],
}

// Mutable state passed to picture cache tiles during post_update
@@ -1210,7 +1213,21 @@ impl Tile {
let clipped_rect = self.current_descriptor.local_valid_rect
.intersection(&ctx.local_clip_rect)
.unwrap_or_else(PictureRect::zero);
let is_opaque = ctx.backdrop.rect.contains_rect(&clipped_rect);
let mut is_opaque = ctx.backdrop.rect.contains_rect(&clipped_rect);

if self.has_compositor_surface {
// TODO(gw): This will almost always select over blend, due to the
// background rectangle. In future, we can optimize this
// case to only check items that come _after_ the compositor
// surface z_id? A better option might be to tweak the z_id
// values so that the alpha pixels get z-rejected?
for surface in ctx.external_surfaces {
if surface.device_rect.intersects(&self.device_valid_rect) {
is_opaque = false;
break;
}
}
}

if is_opaque != self.is_opaque {
// If opacity changed, the native compositor surface and all tiles get invalidated.
@@ -3217,6 +3234,7 @@ impl TileCacheInstance {
color_bindings: &self.color_bindings,
current_tile_size: self.current_tile_size,
local_rect: self.local_rect,
external_surfaces: &self.external_surfaces,
};

let mut state = TilePostUpdateState {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.