зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 6493da33ecac (bug 1589669) for failing at test_bug1277814.html on a CLOSED TREE.
This commit is contained in:
Родитель
ca3cb5e25d
Коммит
5f548f331e
|
@ -728,7 +728,7 @@ void APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
|
|||
LayoutDevicePoint asyncScrollDelta = -layerTranslation / zoom;
|
||||
aTxn.UpdateScrollPosition(wr::AsPipelineId(apzc->GetGuid().mLayersId),
|
||||
apzc->GetGuid().mScrollId,
|
||||
wr::ToLayoutPoint(asyncScrollDelta));
|
||||
wr::ToRoundedLayoutPoint(asyncScrollDelta));
|
||||
|
||||
apzc->ReportCheckerboard(aSampleTime);
|
||||
}
|
||||
|
|
|
@ -758,8 +758,8 @@ impl Tile {
|
|||
|
||||
// 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;
|
||||
let fract_changed = (self.fract_offset.x - ctx.fract_offset.x).abs() > 0.001 ||
|
||||
(self.fract_offset.y - ctx.fract_offset.y).abs() > 0.001;
|
||||
if fract_changed {
|
||||
self.invalidate(None, InvalidationReason::FractionalOffset);
|
||||
self.fract_offset = ctx.fract_offset;
|
||||
|
@ -3245,9 +3245,9 @@ impl PicturePrimitive {
|
|||
|
||||
// Round the scale up to the nearest power of 2, but don't exceed 8.
|
||||
let scale = scale_factors.0.max(scale_factors.1).min(8.0);
|
||||
let rounded_up = 2.0f32.powf(scale.log2().ceil());
|
||||
let rounded_up = 1 << scale.log2().ceil() as u32;
|
||||
|
||||
RasterSpace::Local(rounded_up)
|
||||
RasterSpace::Local(rounded_up as f32)
|
||||
} else {
|
||||
self.requested_raster_space
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ use api::{ExternalScrollId, PipelineId, PropertyBinding, PropertyBindingId, Refe
|
|||
use api::{TransformStyle, ScrollSensitivity, StickyOffsetBounds};
|
||||
use api::units::*;
|
||||
use crate::clip_scroll_tree::{CoordinateSystem, CoordinateSystemId, SpatialNodeIndex, TransformUpdateState};
|
||||
use euclid::{Point2D, Vector2D, SideOffsets2D};
|
||||
use euclid::{Scale, SideOffsets2D};
|
||||
use crate::scene::SceneProperties;
|
||||
use crate::util::{LayoutFastTransform, MatrixHelpers, ScaleOffset, TransformedRectKind, PointHelpers};
|
||||
use crate::util::{LayoutFastTransform, MatrixHelpers, ScaleOffset, TransformedRectKind, VectorHelpers};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum SpatialNodeType {
|
||||
|
@ -113,18 +113,14 @@ fn compute_offset_from(
|
|||
/// where snapping is not important (e.g. has perspective or is not axis
|
||||
/// aligned), or an edge case (e.g. SVG filters) which we can accept
|
||||
/// imperfection for now.
|
||||
fn snap_offset<OffsetUnits, ScaleUnits>(
|
||||
offset: Vector2D<f32, OffsetUnits>,
|
||||
scale: Vector2D<f32, ScaleUnits>,
|
||||
fn snap_offset(
|
||||
offset: LayoutVector2D,
|
||||
global_device_pixel_scale: DevicePixelScale,
|
||||
) -> Vector2D<f32, OffsetUnits> {
|
||||
|
||||
debug_assert!(scale.x != 0.0 && scale.y != 0.0);
|
||||
|
||||
let world_offset = Point2D::new(offset.x * scale.x, offset.y * scale.y);
|
||||
) -> LayoutVector2D {
|
||||
let world_offset = offset * Scale::new(1.0);
|
||||
let snapped_device_offset = (world_offset * global_device_pixel_scale).snap();
|
||||
let snapped_world_offset = snapped_device_offset / global_device_pixel_scale;
|
||||
Vector2D::new(snapped_world_offset.x / scale.x, snapped_world_offset.y / scale.y)
|
||||
snapped_world_offset * Scale::new(1.0)
|
||||
}
|
||||
|
||||
impl SpatialNode {
|
||||
|
@ -238,8 +234,8 @@ impl SpatialNode {
|
|||
|
||||
let origin = LayoutPoint::new(origin.x.max(0.0), origin.y.max(0.0));
|
||||
LayoutVector2D::new(
|
||||
(-origin.x).max(-scrollable_width).min(0.0),
|
||||
(-origin.y).max(-scrollable_height).min(0.0),
|
||||
(-origin.x).max(-scrollable_width).min(0.0).round(),
|
||||
(-origin.y).max(-scrollable_height).min(0.0).round(),
|
||||
)
|
||||
}
|
||||
ScrollClamping::NoClamping => LayoutPoint::zero() - *origin,
|
||||
|
@ -353,7 +349,7 @@ impl SpatialNode {
|
|||
// between our reference frame and this node. Finally, we also include
|
||||
// whatever local transformation this reference frame provides.
|
||||
let relative_transform = resolved_transform
|
||||
.post_translate(snap_offset(state.parent_accumulated_scroll_offset, state.coordinate_system_relative_scale_offset.scale, global_device_pixel_scale))
|
||||
.post_translate(snap_offset(state.parent_accumulated_scroll_offset, global_device_pixel_scale))
|
||||
.to_transform()
|
||||
.with_destination::<LayoutPixel>();
|
||||
|
||||
|
@ -428,13 +424,13 @@ impl SpatialNode {
|
|||
// provided by our own sticky positioning.
|
||||
let accumulated_offset = state.parent_accumulated_scroll_offset + sticky_offset;
|
||||
self.viewport_transform = state.coordinate_system_relative_scale_offset
|
||||
.offset(snap_offset(accumulated_offset, state.coordinate_system_relative_scale_offset.scale, global_device_pixel_scale).to_untyped());
|
||||
.offset(snap_offset(accumulated_offset, global_device_pixel_scale).to_untyped());
|
||||
|
||||
// The transformation for any content inside of us is the viewport transformation, plus
|
||||
// whatever scrolling offset we supply as well.
|
||||
let added_offset = accumulated_offset + self.scroll_offset();
|
||||
self.content_transform = state.coordinate_system_relative_scale_offset
|
||||
.offset(snap_offset(added_offset, state.coordinate_system_relative_scale_offset.scale, global_device_pixel_scale).to_untyped());
|
||||
.offset(snap_offset(added_offset, global_device_pixel_scale).to_untyped());
|
||||
|
||||
if let SpatialNodeType::StickyFrame(ref mut info) = self.node_type {
|
||||
info.current_offset = sticky_offset;
|
||||
|
@ -635,13 +631,15 @@ impl SpatialNode {
|
|||
if scrollable_width > 0. {
|
||||
scrolling.offset.x = (scrolling.offset.x + delta.x)
|
||||
.min(0.0)
|
||||
.max(-scrollable_width);
|
||||
.max(-scrollable_width)
|
||||
.round();
|
||||
}
|
||||
|
||||
if scrollable_height > 0. {
|
||||
scrolling.offset.y = (scrolling.offset.y + delta.y)
|
||||
.min(0.0)
|
||||
.max(-scrollable_height);
|
||||
.max(-scrollable_height)
|
||||
.round();
|
||||
}
|
||||
|
||||
scrolling.offset != original_layer_scroll_offset
|
||||
|
|
Загрузка…
Ссылка в новой задаче