Bug 1453935 - Ensure that we snap within the visible rect with WebRender. r=kvark

Differential Revision: https://phabricator.services.mozilla.com/D18869
This commit is contained in:
Andrew Osmond 2019-02-07 18:05:43 -05:00
Родитель 7e3beb59f7
Коммит 6cba1775c3
10 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

@ -102,11 +102,15 @@ VertexInfo write_vertex(RectWithSize instance_rect,
// Clamp to the two local clip rects.
vec2 clamped_local_pos = clamp_rect(local_pos, local_clip_rect);
// Compute the visible rect to snap against. This ensures segments along the
// edges are snapped consistently with other nearby primitives.
RectWithSize visible_rect = intersect_rects(local_clip_rect, snap_rect);
/// Compute the snapping offset.
vec2 snap_offset = compute_snap_offset(
clamped_local_pos,
transform.m,
snap_rect,
visible_rect,
task.common_data.device_pixel_scale
);

Просмотреть файл

@ -51,7 +51,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use storage;
use util::{ScaleOffset, MatrixHelpers, MaxRect, Recycler, TransformedRectKind};
use util::{pack_as_float, project_rect, raster_rect_to_device_pixels};
use util::{scale_factors, clamp_to_scale_factor, RectHelpers};
use util::{scale_factors, clamp_to_scale_factor};
use smallvec::SmallVec;
pub mod borders;
@ -3535,9 +3535,9 @@ fn compute_snap_offset_impl(
)
}
/// Retrieve the exact device space rectangle for a primitive, taking
/// into account the snapping that the shaders will apply if the transform
/// is axis-aligned.
/// Retrieve the exact unsnapped device space rectangle for a primitive.
/// If the transform is axis-aligned, compute the snapping offsets that
/// the shaders will apply.
fn get_unclipped_device_rect(
prim_spatial_node_index: SpatialNodeIndex,
root_spatial_node_index: SpatialNodeIndex,
@ -3582,11 +3582,7 @@ fn get_unclipped_device_rect(
bottom_right,
};
let p0 = unclipped_device_rect.origin + top_left;
let p1 = unclipped_device_rect.bottom_right() + bottom_right;
let unclipped = DeviceRect::from_floats(p0.x, p0.y, p1.x, p1.y);
Some((unclipped, snap_offsets))
Some((unclipped_device_rect, snap_offsets))
}
TransformedRectKind::Complex => {
Some((unclipped_device_rect, SnapOffsets::empty()))

Просмотреть файл

@ -14,7 +14,7 @@ platform(linux,mac) == border-suite-3.yaml border-suite-3.png
== border-double-simple-2.yaml border-double-simple-2-ref.yaml
fuzzy(64,24) == border-groove-simple.yaml border-groove-simple-ref.yaml
fuzzy(64,24) == border-ridge-simple.yaml border-ridge-simple-ref.yaml
platform(linux,mac) fuzzy(1,2) == degenerate-curve.yaml degenerate-curve.png
platform(linux,mac) fuzzy(1,3) == degenerate-curve.yaml degenerate-curve.png
platform(linux,mac) == border-image.yaml border-image-ref.png
== border-image-crash.yaml border-image-crash-ref.yaml
== border-image-fill.yaml border-image-fill-ref.png

Просмотреть файл

@ -34,4 +34,4 @@ fuzzy(1,5) platform(linux,mac) == box-shadow-huge-radius.yaml box-shadow-huge-ra
platform(linux,mac) == box-shadow-large-blur-radius-2.yaml box-shadow-large-blur-radius-2.png
platform(linux,mac) == box-shadow-large-blur-radius-3.yaml box-shadow-large-blur-radius-3.png
platform(linux,mac) == scale.yaml scale.png
platform(linux,mac) fuzzy(1,79) == scale.yaml scale.png

Просмотреть файл

@ -25,7 +25,7 @@ platform(linux,mac) == perspective-mask.yaml perspective-mask.png
rotate-clip.yaml rotate-clip-ref.yaml
clip-translate.yaml clip-translate-ref.yaml
platform(linux,mac) == perspective-clip.yaml perspective-clip.png
platform(linux,mac) == perspective-clip-1.yaml perspective-clip-1.png
platform(linux,mac) fuzzy(1,2) == perspective-clip-1.yaml perspective-clip-1.png
platform(linux,mac) fuzzy(1,2) == perspective-shadow.yaml perspective-shadow.png
== complex-preserve-3d.yaml blank.yaml
platform(linux,mac) fuzzy(9,348) == perspective-border-radius.yaml perspective-border-radius.png

Просмотреть файл

@ -48,14 +48,14 @@ fuzzy(0-1,0-149) fuzzy-if(OSX,0-1,0-10595) fuzzy-if(webrender,1-3,24999-25136) =
fuzzy(0-1,0-433) fuzzy-if(skiaContent,0-1,0-2500) fuzzy-if(webrender,1-3,84138-85584) == border-image-linear-gradient-slice-fill-1.html border-image-linear-gradient-slice-fill-1-ref.html
fuzzy(0-1,0-177) fuzzy-if(OSX,0-1,0-25771) fuzzy-if(skiaContent&&!Android,0-1,0-400) fuzzy-if(Android,0-1,0-6093) fuzzy-if(webrender,1-3,57249-57464) == border-image-linear-gradient-slice-fill-2.html border-image-linear-gradient-slice-fill-2-ref.html
fuzzy(0-1,0-48) fuzzy-if(OSX,0-5,0-1676) fuzzy-if(webrender,1-1,4464-4537) == border-image-linear-gradient-width.html border-image-linear-gradient-width-ref.html
fuzzy(0-1,0-5000) fuzzy-if(OSX,0-1,0-15000) fuzzy-if(webrender,2-2,58629-58936) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
fuzzy(0-1,0-3000) fuzzy-if(OSX,0-1,0-6000) fuzzy-if(webrender,1-3,26067-26413) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
fuzzy(0-1,0-5000) fuzzy-if(OSX,0-1,0-15000) fuzzy-if(webrender,2-2,58629-58939) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
fuzzy(0-1,0-3000) fuzzy-if(OSX,0-1,0-6000) fuzzy-if(webrender,1-3,25940-26413) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
fuzzy(0-1,0-12) fuzzy-if(skiaContent,0-1,0-400) fuzzy-if(webrender,1-3,26195-26872) == border-image-linear-gradient-repeat-repeat-1.html border-image-linear-gradient-repeat-repeat-1-ref.html
fuzzy(0-1,0-13) fuzzy-if(skiaContent,0-1,0-300) fuzzy-if(webrender,1-3,26168-27131) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html
fuzzy-if(webrender,1-3,64826-67805) == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html
fuzzy(0-1,0-576) fuzzy-if(skiaContent,0-1,0-2000) fuzzy-if(webrender,1-2,64575-68383) == border-image-linear-gradient-repeat-round-2.html border-image-linear-gradient-repeat-round-2-ref.html
fuzzy(0-1,0-8533) fuzzy-if(webrender,1-3,84604-85925) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html
fuzzy(0-1,0-7161) fuzzy-if(webrender,2-3,92540-93290) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html
fuzzy(0-1,0-7161) fuzzy-if(webrender,1-3,85706-86037) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html
fuzzy-if(webrender,0-1,0-2096) == border-image-radial-gradient.html border-image-radial-gradient-ref.html
fuzzy(0-1,0-42) fuzzy-if(skiaContent,0-2,0-20) fuzzy-if(webrender,0-1,0-37818) == border-image-radial-gradient-slice-1.html border-image-radial-gradient-slice-1-ref.html

Просмотреть файл

@ -318,7 +318,7 @@ fuzzy-if(Android,0-3,0-50) fuzzy-if(skiaContent,0-1,0-133) == 273681-1.html 2736
== 283686-2.html 283686-2-ref.html
== 283686-3.html about:blank
== 289384-1.xhtml 289384-ref.xhtml
fails-if(webrender&&gtkWidget) random-if(d2d) fuzzy-if(webrender&&cocoaWidget,1-2,400-900) fuzzy-if(Android,0-8,0-1439) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
random-if(d2d) fuzzy-if(Android,0-8,0-1439) fuzzy-if(webrender,0-6,0-1124) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
== 290129-1.html 290129-1-ref.html
== 291078-1.html 291078-1-ref.html
== 291078-2.html 291078-2-ref.html

Просмотреть файл

@ -27,7 +27,7 @@ fuzzy-if(!contentSameGfxBackendAsCanvas,0-3,0-88500) fuzzy-if(azureSkiaGL||skiaC
fuzzy-if(!contentSameGfxBackendAsCanvas,0-3,0-88500) fuzzy-if(azureSkiaGL||skiaContent,0-3,0-89700) == linear-vertical-1b.html linear-vertical-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,0-3,0-88500) fuzzy-if(azureSkiaGL||skiaContent,0-3,0-89700) == linear-vertical-1c.html linear-vertical-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,0-3,0-88500) fuzzy-if(azureSkiaGL||skiaContent,0-3,0-89700) == linear-vertical-1d.html linear-vertical-1-ref.html
fuzzy-if(webrender&&cocoaWidget,0-1,0-98) == linear-vertical-subpixel-1.html linear-vertical-subpixel-1-ref.html
fuzzy-if(webrender,0-3,0-21070) == linear-vertical-subpixel-1.html linear-vertical-subpixel-1-ref.html
== linear-viewport.html linear-viewport-ref.html
== nostops.html about:blank
== onestop.html about:blank

Просмотреть файл

@ -185,9 +185,9 @@ fails-if(!webrender) random-if(webrender) == object-position-svg-001e.html objec
== object-position-svg-001i.html object-position-svg-001-ref.html
fails-if(!webrender) random-if(webrender) == object-position-svg-001o.html object-position-svg-001-ref.html # bug 1103286
== object-position-svg-001p.html object-position-svg-001-ref.html
fails-if(!webrender) == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286
fails == object-position-svg-002e.html object-position-svg-002-ref.html # bug 1103286
== object-position-svg-002i.html object-position-svg-002-ref.html
fails-if(!webrender) == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286
fails == object-position-svg-002o.html object-position-svg-002-ref.html # bug 1103286
== object-position-svg-002p.html object-position-svg-002-ref.html
# Tests for gradient color stops with 'currentcolor'

Просмотреть файл

@ -1,5 +1,5 @@
== progressbar-fallback-default-style.html progressbar-fallback-default-style-ref.html
fuzzy-if(Android,0-17,0-1120) fuzzy-if(webrender&&winWidget,0-1,0-5) == meter-native-style.html meter-native-style-ref.html
fuzzy-if(Android,0-17,0-1120) fuzzy-if(webrender,0-8,0-480) == meter-native-style.html meter-native-style-ref.html
skip-if(!cocoaWidget) == meter-vertical-native-style.html meter-vertical-native-style-ref.html # dithering
== meter-fallback-default-style.html meter-fallback-default-style-ref.html
load 664925.xhtml