Title: [258317] trunk
Revision
258317
Author
commit-qu...@webkit.org
Date
2020-03-12 01:10:15 -0700 (Thu, 12 Mar 2020)

Log Message

[GPU Process] GraphicsContextStateChange must accumulate fill and stroke fields as single properties
https://bugs.webkit.org/show_bug.cgi?id=208971

Patch by Said Abou-Hallawa <sabouhall...@apple.com> on 2020-03-12
Reviewed by Simon Fraser.

Source/WebCore:

Setting the fill or the stroke should set one field: color, gradient or
pattern. When detecting a change any of them, accumulate() should copy
all of the fields from the source state to the destination state.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContextStateChange::accumulate):
* platform/graphics/GraphicsContext.h:

LayoutTests:

Adjust the change-flags values in the displaylists tests since the first
bit was not used.

* displaylists/canvas-display-list-expected.txt:
* displaylists/extent-includes-shadow-expected.txt:
* displaylists/extent-includes-transforms-expected.txt:
* displaylists/layer-dispay-list-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (258316 => 258317)


--- trunk/LayoutTests/ChangeLog	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/LayoutTests/ChangeLog	2020-03-12 08:10:15 UTC (rev 258317)
@@ -1,3 +1,18 @@
+2020-03-12  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        [GPU Process] GraphicsContextStateChange must accumulate fill and stroke fields as single properties
+        https://bugs.webkit.org/show_bug.cgi?id=208971
+
+        Reviewed by Simon Fraser.
+
+        Adjust the change-flags values in the displaylists tests since the first
+        bit was not used.
+
+        * displaylists/canvas-display-list-expected.txt:
+        * displaylists/extent-includes-shadow-expected.txt:
+        * displaylists/extent-includes-transforms-expected.txt:
+        * displaylists/layer-dispay-list-expected.txt:
+
 2020-03-12  Diego Pino Garcia  <dp...@igalia.com>
 
         [GTK] Gardening, update TestExpectations

Modified: trunk/LayoutTests/displaylists/canvas-display-list-expected.txt (258316 => 258317)


--- trunk/LayoutTests/displaylists/canvas-display-list-expected.txt	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/LayoutTests/displaylists/canvas-display-list-expected.txt	2020-03-12 08:10:15 UTC (rev 258317)
@@ -1,7 +1,7 @@
  
 (save)
 (set-state
-  (change-flags 1050912)
+  (change-flags 525456)
   (stroke-thickness 1.00)
   (fill-color #C80000)
   (shadows-ignore-transforms 1))
@@ -9,7 +9,7 @@
   (extent at (10,10) size 55x50)
   (rect at (10,10) size 55x50))
 (set-state
-  (change-flags 256)
+  (change-flags 128)
   (fill-color #0000C880))
 (fill-rect
   (extent at (30,30) size 55x50)

Modified: trunk/LayoutTests/displaylists/extent-includes-shadow-expected.txt (258316 => 258317)


--- trunk/LayoutTests/displaylists/extent-includes-shadow-expected.txt	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/LayoutTests/displaylists/extent-includes-shadow-expected.txt	2020-03-12 08:10:15 UTC (rev 258317)
@@ -4,7 +4,7 @@
   (y 0.00))
 (save)
 (set-state
-  (change-flags 1024)
+  (change-flags 512)
   (shadow-blur 12.00)
   (shadow-offset width=10 height=20)
   (shadows-use-legacy-radius 0))

Modified: trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt (258316 => 258317)


--- trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt	2020-03-12 08:10:15 UTC (rev 258317)
@@ -6,7 +6,7 @@
   (ctm {m=((0.87,0.50)(-0.50,0.87)) t=(81.70,-18.30)}))
 (save)
 (set-state
-  (change-flags 1024)
+  (change-flags 512)
   (shadow-blur 12.00)
   (shadow-offset width=10 height=20)
   (shadows-use-legacy-radius 0))

Modified: trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt (258316 => 258317)


--- trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/LayoutTests/displaylists/layer-dispay-list-expected.txt	2020-03-12 08:10:15 UTC (rev 258317)
@@ -9,7 +9,7 @@
   (composite-operation source-over)
   (blend-mode normal))
 (set-state
-  (change-flags 65920)
+  (change-flags 32960)
   (fill-color #0000FF)
   (stroke-style 0)
   (should-antialias 0))

Modified: trunk/Source/WebCore/ChangeLog (258316 => 258317)


--- trunk/Source/WebCore/ChangeLog	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/Source/WebCore/ChangeLog	2020-03-12 08:10:15 UTC (rev 258317)
@@ -1,3 +1,18 @@
+2020-03-12  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        [GPU Process] GraphicsContextStateChange must accumulate fill and stroke fields as single properties
+        https://bugs.webkit.org/show_bug.cgi?id=208971
+
+        Reviewed by Simon Fraser.
+
+        Setting the fill or the stroke should set one field: color, gradient or
+        pattern. When detecting a change any of them, accumulate() should copy
+        all of the fields from the source state to the destination state.
+
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContextStateChange::accumulate):
+        * platform/graphics/GraphicsContext.h:
+
 2020-03-11  Antoine Quint  <grao...@webkit.org>
 
         AnimationTimeline should not have multiple HashMaps with raw Element* keys

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (258316 => 258317)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2020-03-12 08:10:15 UTC (rev 258317)
@@ -121,17 +121,17 @@
 void GraphicsContextStateChange::accumulate(const GraphicsContextState& state, GraphicsContextState::StateChangeFlags flags)
 {
     // FIXME: This code should move to GraphicsContextState.
-    if (flags.contains(GraphicsContextState::StrokeGradientChange))
+    if (flags.containsAny({ GraphicsContextState::StrokeColorChange, GraphicsContextState::StrokeGradientChange, GraphicsContextState::StrokePatternChange })) {
+        m_state.strokeColor = state.strokeColor;
         m_state.strokeGradient = state.strokeGradient;
-
-    if (flags.contains(GraphicsContextState::StrokePatternChange))
         m_state.strokePattern = state.strokePattern;
+    }
 
-    if (flags.contains(GraphicsContextState::FillGradientChange))
+    if (flags.containsAny({ GraphicsContextState::FillColorChange, GraphicsContextState::FillGradientChange, GraphicsContextState::FillPatternChange })) {
+        m_state.fillColor = state.fillColor;
         m_state.fillGradient = state.fillGradient;
-
-    if (flags.contains(GraphicsContextState::FillPatternChange))
         m_state.fillPattern = state.fillPattern;
+    }
 
     if (flags.contains(GraphicsContextState::ShadowChange)) {
         // FIXME: Deal with state.shadowsUseLegacyRadius.
@@ -146,12 +146,6 @@
     if (flags.contains(GraphicsContextState::TextDrawingModeChange))
         m_state.textDrawingMode = state.textDrawingMode;
 
-    if (flags.contains(GraphicsContextState::StrokeColorChange))
-        m_state.strokeColor = state.strokeColor;
-
-    if (flags.contains(GraphicsContextState::FillColorChange))
-        m_state.fillColor = state.fillColor;
-
     if (flags.contains(GraphicsContextState::StrokeStyleChange))
         m_state.strokeStyle = state.strokeStyle;
 

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (258316 => 258317)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2020-03-12 07:48:06 UTC (rev 258316)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2020-03-12 08:10:15 UTC (rev 258317)
@@ -173,28 +173,28 @@
     }
 
     enum Change : uint32_t {
-        StrokeGradientChange                    = 1 << 1,
-        StrokePatternChange                     = 1 << 2,
-        FillGradientChange                      = 1 << 3,
-        FillPatternChange                       = 1 << 4,
-        StrokeThicknessChange                   = 1 << 5,
-        StrokeColorChange                       = 1 << 6,
-        StrokeStyleChange                       = 1 << 7,
-        FillColorChange                         = 1 << 8,
-        FillRuleChange                          = 1 << 9,
-        ShadowChange                            = 1 << 10,
-        ShadowsIgnoreTransformsChange           = 1 << 11,
-        AlphaChange                             = 1 << 12,
-        CompositeOperationChange                = 1 << 13,
-        BlendModeChange                         = 1 << 14,
-        TextDrawingModeChange                   = 1 << 15,
-        ShouldAntialiasChange                   = 1 << 16,
-        ShouldSmoothFontsChange                 = 1 << 17,
-        ShouldSubpixelQuantizeFontsChange       = 1 << 18,
-        DrawLuminanceMaskChange                 = 1 << 19,
-        ImageInterpolationQualityChange         = 1 << 20,
+        StrokeGradientChange                    = 1 << 0,
+        StrokePatternChange                     = 1 << 1,
+        FillGradientChange                      = 1 << 2,
+        FillPatternChange                       = 1 << 3,
+        StrokeThicknessChange                   = 1 << 4,
+        StrokeColorChange                       = 1 << 5,
+        StrokeStyleChange                       = 1 << 6,
+        FillColorChange                         = 1 << 7,
+        FillRuleChange                          = 1 << 8,
+        ShadowChange                            = 1 << 9,
+        ShadowsIgnoreTransformsChange           = 1 << 10,
+        AlphaChange                             = 1 << 11,
+        CompositeOperationChange                = 1 << 12,
+        BlendModeChange                         = 1 << 13,
+        TextDrawingModeChange                   = 1 << 14,
+        ShouldAntialiasChange                   = 1 << 15,
+        ShouldSmoothFontsChange                 = 1 << 16,
+        ShouldSubpixelQuantizeFontsChange       = 1 << 17,
+        DrawLuminanceMaskChange                 = 1 << 18,
+        ImageInterpolationQualityChange         = 1 << 19,
 #if HAVE(OS_DARK_MODE_SUPPORT)
-        UseDarkAppearanceChange                 = 1 << 21,
+        UseDarkAppearanceChange                 = 1 << 20,
 #endif
     };
     typedef OptionSet<Change> StateChangeFlags;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to