Bug 1511814 - Update webrender to commit add1538234a214a371e471bff67734afd7c3ca95 (WR PR #3381). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Tue, 04 Dec 2018 12:45:26 +0000
changeset 508503 8f21a826a2b69e2778948de40d505bf4a24a5200
parent 508502 5516f3e7b817f0ec3543d0fa6295c01e4363238b
child 508504 f3c5235419537c434139d62f9bbebc1165c806b7
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1511814
milestone65.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 1511814 - Update webrender to commit add1538234a214a371e471bff67734afd7c3ca95 (WR PR #3381). r=kats https://github.com/servo/webrender/pull/3381 Differential Revision: https://phabricator.services.mozilla.com/D13724
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/batch.rs
gfx/wr/webrender/src/prim_store.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-a1758f0fc17a71c8d53387be5e9da42495ee11ae
+add1538234a214a371e471bff67734afd7c3ca95
--- a/gfx/wr/webrender/src/batch.rs
+++ b/gfx/wr/webrender/src/batch.rs
@@ -581,17 +581,17 @@ impl AlphaBatchBuilder {
 
                 let batch_key = BatchKey {
                     blend_mode: BlendMode::PremultipliedDestOut,
                     kind: BatchKind::Brush(BrushBatchKind::Solid),
                     textures: BatchTextures::no_texture(),
                 };
 
                 let instance = PrimitiveInstanceData::from(BrushInstance {
-                    segment_index: 0,
+                    segment_index: INVALID_SEGMENT_INDEX,
                     edge_flags: EdgeAaSegmentMask::all(),
                     clip_task_address,
                     brush_flags: BrushFlags::PERSPECTIVE_INTERPOLATION,
                     prim_header_index,
                     user_data: 0,
                 });
 
                 self.batch_list.push_single_instance(
@@ -857,17 +857,17 @@ impl AlphaBatchBuilder {
 
                 let batch_key = BatchKey {
                     blend_mode,
                     kind: BatchKind::Brush(batch_kind),
                     textures: textures,
                 };
 
                 let instance = PrimitiveInstanceData::from(BrushInstance {
-                    segment_index: 0,
+                    segment_index: INVALID_SEGMENT_INDEX,
                     edge_flags: EdgeAaSegmentMask::all(),
                     clip_task_address,
                     brush_flags: BrushFlags::PERSPECTIVE_INTERPOLATION,
                     prim_header_index,
                     user_data: segment_user_data,
                 });
 
                 self.batch_list.push_single_instance(
@@ -1102,17 +1102,17 @@ impl AlphaBatchBuilder {
                                         let prim_header_index = prim_headers.push(&prim_header, z_id, [
                                             ShaderColorMode::Image as i32 | ((AlphaType::PremultipliedAlpha as i32) << 16),
                                             RasterizationSpace::Screen as i32,
                                             get_shader_opacity(1.0),
                                         ]);
 
                                         let instance = BrushInstance {
                                             prim_header_index,
-                                            segment_index: 0,
+                                            segment_index: INVALID_SEGMENT_INDEX,
                                             edge_flags: EdgeAaSegmentMask::empty(),
                                             brush_flags: BrushFlags::empty(),
                                             clip_task_address,
                                             user_data: uv_rect_address.as_int(),
                                         };
 
                                         self.batch_list.push_single_instance(
                                             key,
@@ -1184,26 +1184,26 @@ impl AlphaBatchBuilder {
                                             ShaderColorMode::Alpha as i32 | ((AlphaType::PremultipliedAlpha as i32) << 16),
                                             RasterizationSpace::Screen as i32,
                                             get_shader_opacity(1.0),
                                         ]);
 
                                         let shadow_instance = BrushInstance {
                                             prim_header_index: shadow_prim_header_index,
                                             clip_task_address,
-                                            segment_index: 0,
+                                            segment_index: INVALID_SEGMENT_INDEX,
                                             edge_flags: EdgeAaSegmentMask::empty(),
                                             brush_flags: BrushFlags::empty(),
                                             user_data: shadow_uv_rect_address,
                                         };
 
                                         let content_instance = BrushInstance {
                                             prim_header_index: content_prim_header_index,
                                             clip_task_address,
-                                            segment_index: 0,
+                                            segment_index: INVALID_SEGMENT_INDEX,
                                             edge_flags: EdgeAaSegmentMask::empty(),
                                             brush_flags: BrushFlags::empty(),
                                             user_data: content_uv_rect_address,
                                         };
 
                                         self.batch_list.push_single_instance(
                                             shadow_key,
                                             bounding_rect,
@@ -1278,17 +1278,17 @@ impl AlphaBatchBuilder {
                                             uv_rect_address.as_int(),
                                             filter_mode,
                                             user_data,
                                         ]);
 
                                         let instance = BrushInstance {
                                             prim_header_index,
                                             clip_task_address,
-                                            segment_index: 0,
+                                            segment_index: INVALID_SEGMENT_INDEX,
                                             edge_flags: EdgeAaSegmentMask::empty(),
                                             brush_flags: BrushFlags::empty(),
                                             user_data: 0,
                                         };
 
                                         self.batch_list.push_single_instance(
                                             key,
                                             bounding_rect,
@@ -1323,17 +1323,17 @@ impl AlphaBatchBuilder {
                                     mode as u32 as i32,
                                     backdrop_task_address.0 as i32,
                                     source_task_address.0 as i32,
                                 ]);
 
                                 let instance = BrushInstance {
                                     prim_header_index,
                                     clip_task_address,
-                                    segment_index: 0,
+                                    segment_index: INVALID_SEGMENT_INDEX,
                                     edge_flags: EdgeAaSegmentMask::empty(),
                                     brush_flags: BrushFlags::empty(),
                                     user_data: 0,
                                 };
 
                                 self.batch_list.push_single_instance(
                                     key,
                                     bounding_rect,
@@ -1363,17 +1363,17 @@ impl AlphaBatchBuilder {
                                     ShaderColorMode::Image as i32 | ((AlphaType::PremultipliedAlpha as i32) << 16),
                                     RasterizationSpace::Screen as i32,
                                     get_shader_opacity(1.0),
                                 ]);
 
                                 let instance = BrushInstance {
                                     prim_header_index,
                                     clip_task_address,
-                                    segment_index: 0,
+                                    segment_index: INVALID_SEGMENT_INDEX,
                                     edge_flags: EdgeAaSegmentMask::empty(),
                                     brush_flags: BrushFlags::empty(),
                                     user_data: uv_rect_address,
                                 };
 
                                 self.batch_list.push_single_instance(
                                     key,
                                     bounding_rect,
--- a/gfx/wr/webrender/src/prim_store.rs
+++ b/gfx/wr/webrender/src/prim_store.rs
@@ -1012,48 +1012,48 @@ impl From<PrimitiveKey> for PrimitiveTem
     }
 }
 
 impl PrimitiveTemplateKind {
     /// Write any GPU blocks for the primitive template to the given request object.
     fn write_prim_gpu_blocks(
         &self,
         request: &mut GpuDataRequest,
-        prim_rect: LayoutRect,
+        prim_size: LayoutSize,
     ) {
         match *self {
             PrimitiveTemplateKind::Clear => {
                 // Opaque black with operator dest out
                 request.push(PremultipliedColorF::BLACK);
             }
             PrimitiveTemplateKind::Rectangle { ref color, .. } => {
                 request.push(color.premultiplied());
             }
             PrimitiveTemplateKind::NormalBorder { .. } => {
                 // Border primitives currently used for
                 // image borders, and run through the
                 // normal brush_image shader.
                 request.push(PremultipliedColorF::WHITE);
                 request.push(PremultipliedColorF::WHITE);
                 request.push([
-                    prim_rect.size.width,
-                    prim_rect.size.height,
+                    prim_size.width,
+                    prim_size.height,
                     0.0,
                     0.0,
                 ]);
             }
             PrimitiveTemplateKind::ImageBorder { .. } => {
                 // Border primitives currently used for
                 // image borders, and run through the
                 // normal brush_image shader.
                 request.push(PremultipliedColorF::WHITE);
                 request.push(PremultipliedColorF::WHITE);
                 request.push([
-                    prim_rect.size.width,
-                    prim_rect.size.height,
+                    prim_size.width,
+                    prim_size.height,
                     0.0,
                     0.0,
                 ]);
             }
             PrimitiveTemplateKind::LineDecoration { ref cache_key, ref color } => {
                 match cache_key {
                     Some(cache_key) => {
                         request.push(color.premultiplied());
@@ -1160,25 +1160,18 @@ impl PrimitiveTemplateKind {
             }
             PrimitiveTemplateKind::Unused => {}
         }
     }
 
     fn write_segment_gpu_blocks(
         &self,
         request: &mut GpuDataRequest,
-        prim_rect: LayoutRect,
     ) {
         match *self {
-            PrimitiveTemplateKind::Clear => {
-                request.write_segment(
-                    prim_rect,
-                    [0.0; 4],
-                );
-            }
             PrimitiveTemplateKind::NormalBorder { ref template, .. } => {
                 for segment in &template.brush_segments {
                     // has to match VECS_PER_SEGMENT
                     request.write_segment(
                         segment.local_rect,
                         segment.extra_data,
                     );
                 }
@@ -1187,32 +1180,28 @@ impl PrimitiveTemplateKind {
                 for segment in brush_segments {
                     // has to match VECS_PER_SEGMENT
                     request.write_segment(
                         segment.local_rect,
                         segment.extra_data,
                     );
                 }
             }
-            PrimitiveTemplateKind::LineDecoration { .. } => {
-                request.write_segment(
-                    prim_rect,
-                    [0.0; 4],
-                );
-            }
             PrimitiveTemplateKind::LinearGradient { ref brush_segments, .. } |
             PrimitiveTemplateKind::RadialGradient { ref brush_segments, .. } => {
                 for segment in brush_segments {
                     // has to match VECS_PER_SEGMENT
                     request.write_segment(
                         segment.local_rect,
                         segment.extra_data,
                     );
                 }
             }
+            PrimitiveTemplateKind::Clear |
+            PrimitiveTemplateKind::LineDecoration { .. } |
             PrimitiveTemplateKind::Image { .. } |
             PrimitiveTemplateKind::Rectangle { .. } |
             PrimitiveTemplateKind::TextRun { .. } |
             PrimitiveTemplateKind::YuvImage { .. } |
             PrimitiveTemplateKind::Unused => {}
         }
     }
 }
@@ -1228,18 +1217,21 @@ impl PrimitiveTemplate {
         //           code shouldn't depend on current surface state. This is due to a
         //           limitation in how render task caching works. We should fix this by
         //           allowing render task caching to assign to surfaces implicitly
         //           during pass allocation.
         surface_index: SurfaceIndex,
         frame_state: &mut FrameBuildingState,
     ) {
         if let Some(mut request) = frame_state.gpu_cache.request(&mut self.gpu_cache_handle) {
-            self.kind.write_prim_gpu_blocks(&mut request, self.prim_rect);
-            self.kind.write_segment_gpu_blocks(&mut request, self.prim_rect);
+            self.kind.write_prim_gpu_blocks(
+                &mut request,
+                self.prim_rect.size,
+            );
+            self.kind.write_segment_gpu_blocks(&mut request);
         }
 
         self.opacity = match self.kind {
             PrimitiveTemplateKind::Clear => {
                 PrimitiveOpacity::translucent()
             }
             PrimitiveTemplateKind::Rectangle { ref color, .. } => {
                 PrimitiveOpacity::from_alpha(color.a)
@@ -3092,20 +3084,16 @@ impl PrimitiveStore {
                     request.push(PremultipliedColorF::WHITE);
                     request.push(PremultipliedColorF::WHITE);
                     request.push([
                         -1.0,       // -ve means use prim rect for stretch size
                         0.0,
                         0.0,
                         0.0,
                     ]);
-                    request.write_segment(
-                        pic.local_rect,
-                        [0.0; 4],
-                    );
                 }
             }
             PrimitiveInstanceKind::TextRun { .. } |
             PrimitiveInstanceKind::Clear |
             PrimitiveInstanceKind::Rectangle { .. } |
             PrimitiveInstanceKind::NormalBorder { .. } |
             PrimitiveInstanceKind::ImageBorder { .. } |
             PrimitiveInstanceKind::YuvImage { .. } |
@@ -3599,17 +3587,20 @@ impl PrimitiveStore {
 
         debug_assert!(segment_instance_index != SegmentInstanceIndex::INVALID);
         if segment_instance_index != SegmentInstanceIndex::UNUSED {
             let segment_instance = &mut scratch.segment_instances[segment_instance_index];
 
             if let Some(mut request) = frame_state.gpu_cache.request(&mut segment_instance.gpu_cache_handle) {
                 let segments = &scratch.segments[segment_instance.segments_range];
 
-                prim_data.kind.write_prim_gpu_blocks(&mut request, prim_data.prim_rect);
+                prim_data.kind.write_prim_gpu_blocks(
+                    &mut request,
+                    prim_data.prim_rect.size,
+                );
 
                 for segment in segments {
                     request.write_segment(
                         segment.local_rect,
                         [0.0; 4],
                     );
                 }
             }