Bug 1515244 - Update webrender to commit 10cde544d9f7f83a31dbedf67db942f7845982d1 (WR PR #3435). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Wed, 19 Dec 2018 03:21:10 +0000
changeset 451290 6cfb1fdf1ddc001f75b304c219ddb8b3c13dcab7
parent 451289 5baefeddca0c454365b5761f87edf47b696f25b4
child 451291 7359f1ce3a65537fe5c7a2075c58e0cb11b358e3
push id110646
push userebalazs@mozilla.com
push dateWed, 19 Dec 2018 16:05:18 +0000
treeherdermozilla-inbound@1acd86ad823c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1515244
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515244 - Update webrender to commit 10cde544d9f7f83a31dbedf67db942f7845982d1 (WR PR #3435). r=kats https://github.com/servo/webrender/pull/3435 Differential Revision: https://phabricator.services.mozilla.com/D14939
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/picture.rs
gfx/wr/wrench/reftests/transforms/nested-preserve-3d.png
gfx/wr/wrench/reftests/transforms/nested-rotate-x.png
gfx/wr/wrench/reftests/transforms/reftest.list
gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml
gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-237346c5e38cf70749e86a7f402fd9f92b4b5226
+10cde544d9f7f83a31dbedf67db942f7845982d1
--- a/gfx/wr/webrender/src/picture.rs
+++ b/gfx/wr/webrender/src/picture.rs
@@ -2436,16 +2436,17 @@ impl PicturePrimitive {
                         .intersection(&unclipped.to_i32())
                         .unwrap();
 
                     let uv_rect_kind = calculate_uv_rect_kind(
                         &pic_rect,
                         &transform,
                         &device_rect,
                         frame_context.device_pixel_scale,
+                        true,
                     );
 
                     let picture_task = RenderTask::new_picture(
                         RenderTaskLocation::Dynamic(None, device_rect.size),
                         unclipped.size,
                         pic_index,
                         device_rect.origin,
                         child_tasks,
@@ -2475,16 +2476,17 @@ impl PicturePrimitive {
                     // texture cache.
                     let device_rect = unclipped.to_i32();
 
                     let uv_rect_kind = calculate_uv_rect_kind(
                         &pic_rect,
                         &transform,
                         &device_rect,
                         frame_context.device_pixel_scale,
+                        true,
                     );
 
                     // TODO(gw): Probably worth changing the render task caching API
                     //           so that we don't need to always clone the key.
                     let cache_key = self.surface_desc
                         .as_ref()
                         .expect("bug: no cache key for surface")
                         .cache_key
@@ -2550,16 +2552,17 @@ impl PicturePrimitive {
                     .intersection(&unclipped.to_i32())
                     .unwrap();
 
                 let uv_rect_kind = calculate_uv_rect_kind(
                     &pic_rect,
                     &transform,
                     &device_rect,
                     frame_context.device_pixel_scale,
+                    true,
                 );
 
                 let mut picture_task = RenderTask::new_picture(
                     RenderTaskLocation::Dynamic(None, device_rect.size),
                     unclipped.size,
                     pic_index,
                     device_rect.origin,
                     child_tasks,
@@ -2616,16 +2619,17 @@ impl PicturePrimitive {
                 PictureSurface::RenderTask(render_task_id)
             }
             PictureCompositeMode::MixBlend(..) => {
                 let uv_rect_kind = calculate_uv_rect_kind(
                     &pic_rect,
                     &transform,
                     &clipped,
                     frame_context.device_pixel_scale,
+                    true,
                 );
 
                 let picture_task = RenderTask::new_picture(
                     RenderTaskLocation::Dynamic(None, clipped.size),
                     unclipped.size,
                     pic_index,
                     clipped.origin,
                     child_tasks,
@@ -2655,16 +2659,17 @@ impl PicturePrimitive {
                     }
                 }
 
                 let uv_rect_kind = calculate_uv_rect_kind(
                     &pic_rect,
                     &transform,
                     &clipped,
                     frame_context.device_pixel_scale,
+                    true,
                 );
 
                 let picture_task = RenderTask::new_picture(
                     RenderTaskLocation::Dynamic(None, clipped.size),
                     unclipped.size,
                     pic_index,
                     clipped.origin,
                     child_tasks,
@@ -2674,21 +2679,29 @@ impl PicturePrimitive {
                     Vec::new(),
                 );
 
                 let render_task_id = frame_state.render_tasks.add(picture_task);
                 surfaces[surface_index.0].tasks.push(render_task_id);
                 PictureSurface::RenderTask(render_task_id)
             }
             PictureCompositeMode::Blit => {
+                // The SplitComposite shader used for 3d contexts doesn't snap
+                // to pixels, so we shouldn't snap our uv coordinates either.
+                let supports_snapping = match self.context_3d {
+                    Picture3DContext::In{ .. } => false,
+                    _ => true,
+                };
+
                 let uv_rect_kind = calculate_uv_rect_kind(
                     &pic_rect,
                     &transform,
                     &clipped,
                     frame_context.device_pixel_scale,
+                    supports_snapping,
                 );
 
                 let picture_task = RenderTask::new_picture(
                     RenderTaskLocation::Dynamic(None, clipped.size),
                     unclipped.size,
                     pic_index,
                     clipped.origin,
                     child_tasks,
@@ -2711,16 +2724,17 @@ impl PicturePrimitive {
 }
 
 // Calculate a single screen-space UV for a picture.
 fn calculate_screen_uv(
     local_pos: &PicturePoint,
     transform: &PictureToRasterTransform,
     rendered_rect: &DeviceRect,
     device_pixel_scale: DevicePixelScale,
+    supports_snapping: bool,
 ) -> DevicePoint {
     let raster_pos = match transform.transform_point2d(local_pos) {
         Some(pos) => pos,
         None => {
             //Warning: this is incorrect and needs to be fixed properly.
             // The transformation has put a local vertex behind the near clipping plane...
             // Proper solution would be to keep the near-clipping-plane results around
             // (currently produced by calculate_screen_bounding_rect) and use them here.
@@ -2728,17 +2742,17 @@ fn calculate_screen_uv(
         }
     };
 
     let raster_to_device_space = TypedScale::new(1.0) * device_pixel_scale;
 
     let mut device_pos = raster_pos * raster_to_device_space;
 
     // Apply snapping for axis-aligned scroll nodes, as per prim_shared.glsl.
-    if transform.transform_kind() == TransformedRectKind::AxisAligned {
+    if transform.transform_kind() == TransformedRectKind::AxisAligned && supports_snapping {
         device_pos.x = (device_pos.x + 0.5).floor();
         device_pos.y = (device_pos.y + 0.5).floor();
     }
 
     DevicePoint::new(
         (device_pos.x - rendered_rect.origin.x) / rendered_rect.size.width,
         (device_pos.y - rendered_rect.origin.y) / rendered_rect.size.height,
     )
@@ -2746,45 +2760,50 @@ fn calculate_screen_uv(
 
 // Calculate a UV rect within an image based on the screen space
 // vertex positions of a picture.
 fn calculate_uv_rect_kind(
     pic_rect: &PictureRect,
     transform: &PictureToRasterTransform,
     rendered_rect: &DeviceIntRect,
     device_pixel_scale: DevicePixelScale,
+    supports_snapping: bool,
 ) -> UvRectKind {
     let rendered_rect = rendered_rect.to_f32();
 
     let top_left = calculate_screen_uv(
         &pic_rect.origin,
         transform,
         &rendered_rect,
         device_pixel_scale,
+        supports_snapping,
     );
 
     let top_right = calculate_screen_uv(
         &pic_rect.top_right(),
         transform,
         &rendered_rect,
         device_pixel_scale,
+        supports_snapping,
     );
 
     let bottom_left = calculate_screen_uv(
         &pic_rect.bottom_left(),
         transform,
         &rendered_rect,
         device_pixel_scale,
+        supports_snapping,
     );
 
     let bottom_right = calculate_screen_uv(
         &pic_rect.bottom_right(),
         transform,
         &rendered_rect,
         device_pixel_scale,
+        supports_snapping,
     );
 
     UvRectKind::Quad {
         top_left,
         top_right,
         bottom_left,
         bottom_right,
     }
index 6a2fb1d333407413c272f6fe26b103c09c717c0e..4ce47d9b6980e76bdfa3cadca09402b0cb9f1c24
GIT binary patch
literal 3827
zc%1E5ZA?>V6uwxc%<$z0C=*-77!8=pL>w8=0u~rL5e5nau`q%-$^?QU6-q%CkPp2h
z+7VnsC1i?PD5%#04%&sVGKO}<*(x8SXaN;kO0g}awCpVu=MOg!-9LWZyyreS_ul86
z^Stjlw;(9c-(uy*D<KH72>6`%B?Oshz@;-Y1&H0Y6$%KlYz!cJho&>6y)O#rk+%GP
zYOqVt?&bN`_CCpG-klG4o0sRCM|95IR^0Ik+Kr;iqLR;qoJ_fp{FSzxqaUL1T2+-;
z;pFDENjfF7#so?sVj!Oa59qtq6v%9=0<zvGG1+vf4du1H1f3n^U<FkyIV?FWIV?HM
zIPl~m5|uTk%OGDnsOFoBY7kZbUK(pm5l7}E0YFfWsKnkhR?7G>GMfYdt+qO<{tqmf
z;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ms~ryVTyz(i!h*w6Y=oyStmROn?65YS#~T
zX$HFiu>XFR>GlNxm^wALgaAl9n`OFF;j(`I?ea9c<0?U#_qbegsNY6Ac4mDV%h5oP
zHXN#uu*LvTwkEBS4H)=C<r2_wXvc~UI>$5Vgrg&}>|uQ@y&@5aA&aG>j(i|S7elY#
z4*;T2%5WY5a`iXF+|Diq_V2|6Eu0qaV7XU<dq@wM?;B^ph{IFgdn4L6>i`UftevlK
blr&Q!PG(;&(DkUm=PZ=4IWewk6SeRkRAb?b
--- a/gfx/wr/wrench/reftests/transforms/reftest.list
+++ b/gfx/wr/wrench/reftests/transforms/reftest.list
@@ -24,8 +24,9 @@ platform(linux,mac) fuzzy(1,283) == near
 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-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
+== snapped-preserve-3d.yaml snapped-preserve-3d-ref.yaml
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d-ref.yaml
@@ -0,0 +1,19 @@
+---
+root:
+  items:
+    -
+      type: "stacking-context"
+      transform: translate(10, 10.5, 0)
+      items:
+        -
+          type: "stacking-context"
+          transform: translate(10, 10, 0)
+          items:
+            -
+              bounds: [10, 10.5, 200, 1]
+              type: rect
+              color: red
+            -
+              bounds: [10, 0, 200, 1]
+              type: rect
+              color: red
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/snapped-preserve-3d.yaml
@@ -0,0 +1,21 @@
+---
+root:
+  items:
+    -
+      type: "stacking-context"
+      transform: translate(10, 10.5, 0)
+      "transform-style": "preserve-3d"
+      items:
+        -
+          type: "stacking-context"
+          transform: translate(10, 10, 0)
+          "transform-style": "preserve-3d"
+          items:
+            -
+              bounds: [10, 10.5, 200, 1]
+              type: rect
+              color: red
+            -
+              bounds: [10, 0, 200, 1]
+              type: rect
+              color: red