зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 1b7bc7ee74b4 (bug 1642308) for Wd failures in webdriver/tests/find_elements/find.py. CLOSED TREE
This commit is contained in:
Родитель
f348e0a63d
Коммит
7b479ee50b
|
@ -521,7 +521,6 @@ struct TilePreUpdateContext {
|
|||
/// The fractional position of the picture cache, which may
|
||||
/// require invalidation of all tiles.
|
||||
fract_offset: PictureVector2D,
|
||||
device_fract_offset: DeviceVector2D,
|
||||
|
||||
/// The optional background color of the picture cache instance
|
||||
background_color: Option<ColorF>,
|
||||
|
@ -825,8 +824,8 @@ pub enum PrimitiveCompareResultDetail {
|
|||
pub enum InvalidationReason {
|
||||
/// The fractional offset changed
|
||||
FractionalOffset {
|
||||
old: DeviceVector2D,
|
||||
new: DeviceVector2D,
|
||||
old: PictureVector2D,
|
||||
new: PictureVector2D,
|
||||
},
|
||||
/// The background color changed
|
||||
BackgroundColor {
|
||||
|
@ -864,7 +863,7 @@ pub enum InvalidationReason {
|
|||
pub struct TileSerializer {
|
||||
pub rect: PictureRect,
|
||||
pub current_descriptor: TileDescriptor,
|
||||
pub device_fract_offset: DeviceVector2D,
|
||||
pub fract_offset: PictureVector2D,
|
||||
pub id: TileId,
|
||||
pub root: TileNode,
|
||||
pub background_color: Option<ColorF>,
|
||||
|
@ -899,9 +898,6 @@ pub struct Tile {
|
|||
pub device_dirty_rect: DeviceRect,
|
||||
/// Device space rect that contains valid pixels region of this tile.
|
||||
pub device_valid_rect: DeviceRect,
|
||||
/// Device space rect that contains valid pixels region of this tile
|
||||
/// from the previous frame.
|
||||
pub prev_device_valid_rect: DeviceRect,
|
||||
/// Uniquely describes the content of this tile, in a way that can be
|
||||
/// (reasonably) efficiently hashed and compared.
|
||||
pub current_descriptor: TileDescriptor,
|
||||
|
@ -919,7 +915,7 @@ pub struct Tile {
|
|||
/// The current fractional offset of the cache transform root. If this changes,
|
||||
/// all tiles need to be invalidated and redrawn, since snapping differences are
|
||||
/// likely to occur.
|
||||
device_fract_offset: DeviceVector2D,
|
||||
fract_offset: PictureVector2D,
|
||||
/// The tile id is stable between display lists and / or frames,
|
||||
/// if the tile is retained. Useful for debugging tile evictions.
|
||||
pub id: TileId,
|
||||
|
@ -958,7 +954,6 @@ impl Tile {
|
|||
local_tile_box: PictureBox2D::zero(),
|
||||
world_tile_rect: WorldRect::zero(),
|
||||
device_valid_rect: DeviceRect::zero(),
|
||||
prev_device_valid_rect: DeviceRect::zero(),
|
||||
local_dirty_rect: PictureRect::zero(),
|
||||
device_dirty_rect: DeviceRect::zero(),
|
||||
surface: None,
|
||||
|
@ -966,7 +961,7 @@ impl Tile {
|
|||
prev_descriptor: TileDescriptor::new(),
|
||||
is_valid: false,
|
||||
is_visible: false,
|
||||
device_fract_offset: DeviceVector2D::zero(),
|
||||
fract_offset: PictureVector2D::zero(),
|
||||
id,
|
||||
is_opaque: false,
|
||||
root: TileNode::new_leaf(Vec::new()),
|
||||
|
@ -984,7 +979,7 @@ impl Tile {
|
|||
fn print(&self, pt: &mut dyn PrintTreePrinter) {
|
||||
pt.new_level(format!("Tile {:?}", self.id));
|
||||
pt.add_item(format!("local_tile_rect: {:?}", self.local_tile_rect));
|
||||
pt.add_item(format!("device_fract_offset: {:?}", self.device_fract_offset));
|
||||
pt.add_item(format!("fract_offset: {:?}", self.fract_offset));
|
||||
pt.add_item(format!("background_color: {:?}", self.background_color));
|
||||
pt.add_item(format!("invalidation_reason: {:?}", self.invalidation_reason));
|
||||
self.current_descriptor.print(pt);
|
||||
|
@ -1050,7 +1045,7 @@ impl Tile {
|
|||
}
|
||||
// TODO(gw): We can avoid invalidating the whole tile in some cases here,
|
||||
// but it should be a fairly rare invalidation case.
|
||||
if self.device_valid_rect != self.prev_device_valid_rect {
|
||||
if self.current_descriptor.local_valid_rect != self.prev_descriptor.local_valid_rect {
|
||||
self.invalidate(None, InvalidationReason::ValidRectChanged);
|
||||
state.composite_state.dirty_rects_are_valid = false;
|
||||
}
|
||||
|
@ -1118,16 +1113,15 @@ impl Tile {
|
|||
return;
|
||||
}
|
||||
|
||||
// We may need to rerender if glyph subpixel positions have changed. Note
|
||||
// that we update the tile fract offset itself after we have completed
|
||||
// invalidation. This allows for other whole tile invalidation cases to
|
||||
// update the fract offset appropriately.
|
||||
let fract_delta = self.device_fract_offset - ctx.device_fract_offset;
|
||||
let fract_changed = fract_delta.x.abs() > 0.01 || fract_delta.y.abs() > 0.01;
|
||||
// Determine if the fractional offset of the transform is different this frame
|
||||
// from the currently cached tile set.
|
||||
let fract_changed = (self.fract_offset.x - ctx.fract_offset.x).abs() > 0.01 ||
|
||||
(self.fract_offset.y - ctx.fract_offset.y).abs() > 0.01;
|
||||
if fract_changed {
|
||||
self.invalidate(None, InvalidationReason::FractionalOffset {
|
||||
old: self.device_fract_offset,
|
||||
new: ctx.device_fract_offset });
|
||||
old: self.fract_offset,
|
||||
new: ctx.fract_offset });
|
||||
self.fract_offset = ctx.fract_offset;
|
||||
}
|
||||
|
||||
if ctx.background_color != self.background_color {
|
||||
|
@ -1143,7 +1137,6 @@ impl Tile {
|
|||
&mut self.current_descriptor,
|
||||
&mut self.prev_descriptor,
|
||||
);
|
||||
self.prev_device_valid_rect = self.device_valid_rect;
|
||||
self.current_descriptor.clear();
|
||||
self.root.clear(self.local_tile_rect.to_box2d());
|
||||
|
||||
|
@ -2331,8 +2324,6 @@ pub struct TileCacheInstance {
|
|||
frames_until_size_eval: usize,
|
||||
/// The current fractional offset of the cached picture
|
||||
fract_offset: PictureVector2D,
|
||||
/// The current device fractional offset of the cached picture
|
||||
device_fract_offset: DeviceVector2D,
|
||||
/// For DirectComposition, virtual surfaces don't support negative coordinates. However,
|
||||
/// picture cache tile coordinates can be negative. To handle this, we apply an offset
|
||||
/// to each tile in DirectComposition. We want to change this as little as possible,
|
||||
|
@ -2408,7 +2399,6 @@ impl TileCacheInstance {
|
|||
current_tile_size: DeviceIntSize::zero(),
|
||||
frames_until_size_eval: 0,
|
||||
fract_offset: PictureVector2D::zero(),
|
||||
device_fract_offset: DeviceVector2D::zero(),
|
||||
// Default to centering the virtual offset in the middle of the DC virtual surface
|
||||
virtual_offset: DeviceIntPoint::new(
|
||||
params.virtual_surface_size / 2,
|
||||
|
@ -2658,7 +2648,6 @@ impl TileCacheInstance {
|
|||
let device_origin = world_origin * frame_context.global_device_pixel_scale;
|
||||
let desired_device_origin = device_origin.round();
|
||||
self.device_position = desired_device_origin;
|
||||
self.device_fract_offset = desired_device_origin - device_origin;
|
||||
|
||||
// Unmap from device space to world space rect
|
||||
let ref_world_rect = WorldRect::new(
|
||||
|
@ -2666,13 +2655,17 @@ impl TileCacheInstance {
|
|||
WorldSize::new(1.0, 1.0),
|
||||
);
|
||||
|
||||
// Unmap from world space to picture space; this should be the fractional offset
|
||||
// required in picture space to align in device space
|
||||
self.fract_offset = pic_to_world_mapper
|
||||
// Unmap from world space to picture space
|
||||
let ref_point = pic_to_world_mapper
|
||||
.unmap(&ref_world_rect)
|
||||
.expect("bug: unable to unmap ref world rect")
|
||||
.origin
|
||||
.to_vector();
|
||||
.origin;
|
||||
|
||||
// Extract the fractional offset required in picture space to align in device space
|
||||
self.fract_offset = PictureVector2D::new(
|
||||
ref_point.x.fract(),
|
||||
ref_point.y.fract(),
|
||||
);
|
||||
|
||||
// Do a hacky diff of opacity binding values from the last frame. This is
|
||||
// used later on during tile invalidation tests.
|
||||
|
@ -2848,7 +2841,6 @@ impl TileCacheInstance {
|
|||
let ctx = TilePreUpdateContext {
|
||||
pic_to_world_mapper,
|
||||
fract_offset: self.fract_offset,
|
||||
device_fract_offset: self.device_fract_offset,
|
||||
background_color: self.background_color,
|
||||
global_screen_world_rect: frame_context.global_screen_world_rect,
|
||||
tile_size: self.tile_size,
|
||||
|
@ -5450,12 +5442,6 @@ impl PicturePrimitive {
|
|||
}
|
||||
}
|
||||
|
||||
// If the entire tile valid region is dirty, we can update the fract offset
|
||||
// at which the tile was rendered.
|
||||
if tile.device_dirty_rect.contains_rect(&tile.device_valid_rect) {
|
||||
tile.device_fract_offset = tile_cache.device_fract_offset;
|
||||
}
|
||||
|
||||
// Now that the tile is valid, reset the dirty rect.
|
||||
tile.local_dirty_rect = PictureRect::zero();
|
||||
tile.is_valid = true;
|
||||
|
@ -5581,7 +5567,7 @@ impl PicturePrimitive {
|
|||
tile_cache_tiny.tiles.insert(*key, TileSerializer {
|
||||
rect: tile.local_tile_rect,
|
||||
current_descriptor: tile.current_descriptor.clone(),
|
||||
device_fract_offset: tile.device_fract_offset,
|
||||
fract_offset: tile.fract_offset,
|
||||
id: tile.id,
|
||||
root: tile.root.clone(),
|
||||
background_color: tile.background_color,
|
||||
|
|
Загрузка…
Ссылка в новой задаче