Skip to content

Commit

Permalink
Bug 1515040 - Update webrender to commit 9b6c5347c03bd123e0704b7bbd82…
Browse files Browse the repository at this point in the history
…3f3f9fdc9334 (WR PR #3430). r=kats

servo/webrender#3430

Differential Revision: https://phabricator.services.mozilla.com/D14935
  • Loading branch information
WR Updater Bot committed Dec 19, 2018
1 parent 520a787 commit e47c8e7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gfx/webrender_bindings/revision.txt
@@ -1 +1 @@
14df2e43424ebc38044158f716c769d26e35b161
9b6c5347c03bd123e0704b7bbd823f3f9fdc9334
24 changes: 22 additions & 2 deletions gfx/wr/webrender/src/picture.rs
Expand Up @@ -449,7 +449,14 @@ impl TileCache {
.unmap(&world_tile_rect)
.expect("bug: unable to get local tile size");
self.local_tile_size = local_tile_rect.size;
self.local_origin = pic_rect.origin;

// Round the local reference point down to a whole number. This ensures
// that the bounding rect of the tile corresponds to a pixel boundary, and
// the content is offset by a fractional amount inside the surface itself.
// This means that when drawing the tile it's fine to use a simple 0-1
// UV mapping, instead of trying to determine a fractional UV rect that
// is slightly inside the allocated tile surface.
self.local_origin = pic_rect.origin.floor();

// Walk the transforms and see if we need to rebuild the primitive
// dependencies for each tile.
Expand Down Expand Up @@ -894,10 +901,23 @@ impl TileCache {
}
}

// For the primitive origin, store the local origin relative to
// the local origin of the containing picture. This ensures that
// a tile with primitives in the same coordinate system as the
// container picture itself, but different offsets relative to
// the containing picture are correctly invalidated. It does this
// while still maintaining the property of keeping the same hash
// for different display lists where the local origin is different
// but the primitives themselves are at the same relative position.
let origin = PointKey {
x: prim_rect.origin.x - self.local_origin.x,
y: prim_rect.origin.y - self.local_origin.y,
};

// Update the tile descriptor, used for tile comparison during scene swaps.
tile.descriptor.prims.push(PrimitiveDescriptor {
prim_uid: prim_instance.uid(),
origin: prim_instance.prim_origin.into(),
origin,
first_clip: tile.descriptor.clip_uids.len() as u16,
clip_count: clip_chain_uids.len() as u16,
});
Expand Down
4 changes: 2 additions & 2 deletions gfx/wr/webrender/src/prim_store/mod.rs
Expand Up @@ -657,8 +657,8 @@ impl From<LayoutVector2D> for VectorKey {
#[cfg_attr(feature = "replay", derive(Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct PointKey {
x: f32,
y: f32,
pub x: f32,
pub y: f32,
}

impl Eq for PointKey {}
Expand Down

0 comments on commit e47c8e7

Please sign in to comment.