diff options
Diffstat (limited to 'gfx/wr/webrender/src/prim_store/mod.rs')
-rw-r--r-- | gfx/wr/webrender/src/prim_store/mod.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gfx/wr/webrender/src/prim_store/mod.rs b/gfx/wr/webrender/src/prim_store/mod.rs index db5480f597..cc09eab6b1 100644 --- a/gfx/wr/webrender/src/prim_store/mod.rs +++ b/gfx/wr/webrender/src/prim_store/mod.rs @@ -1312,6 +1312,37 @@ impl PrimitiveScratchBuffer { } } + pub fn push_debug_rect_with_stroke_width( + &mut self, + rect: WorldRect, + border: ColorF, + stroke_width: f32 + ) { + let top_edge = WorldRect::new( + WorldPoint::new(rect.min.x + stroke_width, rect.min.y), + WorldPoint::new(rect.max.x - stroke_width, rect.min.y + stroke_width) + ); + self.push_debug_rect(top_edge * DevicePixelScale::new(1.0), border, border); + + let bottom_edge = WorldRect::new( + WorldPoint::new(rect.min.x + stroke_width, rect.max.y - stroke_width), + WorldPoint::new(rect.max.x - stroke_width, rect.max.y) + ); + self.push_debug_rect(bottom_edge * DevicePixelScale::new(1.0), border, border); + + let right_edge = WorldRect::new( + WorldPoint::new(rect.max.x - stroke_width, rect.min.y), + rect.max + ); + self.push_debug_rect(right_edge * DevicePixelScale::new(1.0), border, border); + + let left_edge = WorldRect::new( + rect.min, + WorldPoint::new(rect.min.x + stroke_width, rect.max.y) + ); + self.push_debug_rect(left_edge * DevicePixelScale::new(1.0), border, border); + } + #[allow(dead_code)] pub fn push_debug_rect( &mut self, |