Bug 1526504 - border-style is not drawn with double r=emilio a=lizzard
authorGlenn Watson <github@intuitionlibrary.com>
Tue, 12 Feb 2019 01:20:50 +0000
changeset 513051 ad3595c3b64e
parent 513050 cea43c1728b9
child 513052 f47db91d62e1
push id10697
push usernbeleuzu@mozilla.com
push dateThu, 14 Feb 2019 01:25:42 +0000
treeherdermozilla-beta@f47db91d62e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio, lizzard
bugs1526504
milestone66.0
Bug 1526504 - border-style is not drawn with double r=emilio a=lizzard The WR double style border shader has a condition to check if the widths of the edges are too small to apply the style, in which case it draws the border segment as solid. However, the check was incorrectly skipping when the width of the inner / outer edge was exactly one pixel. Differential Revision: https://phabricator.services.mozilla.com/D19440
gfx/wr/webrender/res/cs_border_segment.glsl
gfx/wr/wrench/reftests/border/border-double-1px-ref.yaml
gfx/wr/wrench/reftests/border/border-double-1px.yaml
gfx/wr/wrench/reftests/border/reftest.list
--- a/gfx/wr/webrender/res/cs_border_segment.glsl
+++ b/gfx/wr/webrender/res/cs_border_segment.glsl
@@ -310,17 +310,17 @@ vec4 evaluate_color_for_style_in_edge(
     int edge_axis_id
 ) {
     vec2 edge_axis = edge_axis_id != 0 ? vec2(0.0, 1.0) : vec2(1.0, 0.0);
     float pos = dot(pos_vec, edge_axis);
     switch (style) {
         case BORDER_STYLE_DOUBLE: {
             float d = -1.0;
             float partial_width = dot(vPartialWidths.xy, edge_axis);
-            if (partial_width > 1.0) {
+            if (partial_width >= 1.0) {
                 vec2 ref = vec2(
                     dot(vEdgeReference.xy, edge_axis) + partial_width,
                     dot(vEdgeReference.zw, edge_axis) - partial_width
                 );
                 d = min(pos - ref.x, ref.y - pos);
             }
             color0 *= distance_aa(aa_range, d);
             break;
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/border/border-double-1px-ref.yaml
@@ -0,0 +1,17 @@
+---
+root:
+  items:
+    - type: stacking-context
+      items:
+        - type: border
+          bounds: [ 10, 10, 100, 20 ]
+          width: 1
+          border-type: normal
+          style: solid
+          color: red
+        - type: border
+          bounds: [ 12, 12, 96, 16 ]
+          width: 1
+          border-type: normal
+          style: solid
+          color: red
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/border/border-double-1px.yaml
@@ -0,0 +1,11 @@
+---
+root:
+  items:
+    - type: stacking-context
+      items:
+        - type: border
+          bounds: [ 10, 10, 100, 20 ]
+          width: 3
+          border-type: normal
+          style: double
+          color: red
--- a/gfx/wr/wrench/reftests/border/reftest.list
+++ b/gfx/wr/wrench/reftests/border/reftest.list
@@ -21,8 +21,9 @@ platform(linux,mac) == border-image.yaml
 platform(linux,mac) == dotted-corner-small-radius.yaml dotted-corner-small-radius.png
 == overlapping.yaml overlapping.png
 == zero-width.yaml blank.yaml
 platform(linux,mac) == small-dotted-border.yaml small-dotted-border.png
 == discontinued-dash.yaml discontinued-dash.png
 platform(linux,mac) == border-dashed-dotted-caching.yaml border-dashed-dotted-caching.png
 != small-inset-outset.yaml small-inset-outset-notref.yaml
 == no-aa.yaml green-square.yaml
+border-double-1px.yaml border-double-1px-ref.yaml