Title: [216502] trunk/Source
Revision
216502
Author
commit-qu...@webkit.org
Date
2017-05-09 05:38:43 -0700 (Tue, 09 May 2017)

Log Message

[Coordinated Graphics] Debug Visuals don't hide
https://bugs.webkit.org/show_bug.cgi?id=162704

Patch by Yoshiaki Jitsukawa <yoshiaki.jitsuk...@sony.com> on 2017-05-09
Reviewed by Žan Doberšek.

Source/WebCore:

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::setDebugBorder):
showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
the "show" argument to the layer state.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::DebugVisuals::DebugVisuals):
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
To set the debug visuals of a layer, the visibility flags of the borders and the repaint
counters as well as the border width and color are needed. Thus a new bundle struct
DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
send the information at once.

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
(IPC::ArgumentCoder<DebugVisuals>::encode):
(IPC::ArgumentCoder<DebugVisuals>::decode):
The encoder and decoder for DebugVisuals have been added.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::setLayerState):
Update the debug visuals of a layer according to the DebugVisuals information
if the debugVisualsChanged flag is set to true.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (216501 => 216502)


--- trunk/Source/WebCore/ChangeLog	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebCore/ChangeLog	2017-05-09 12:38:43 UTC (rev 216502)
@@ -1,3 +1,26 @@
+2017-05-09  Yoshiaki Jitsukawa  <yoshiaki.jitsuk...@sony.com>
+
+        [Coordinated Graphics] Debug Visuals don't hide
+        https://bugs.webkit.org/show_bug.cgi?id=162704
+
+        Reviewed by Žan Doberšek.
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
+        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
+        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
+        (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
+        showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
+        the "show" argument to the layer state.
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
+        (WebCore::DebugVisuals::DebugVisuals):
+        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
+        To set the debug visuals of a layer, the visibility flags of the borders and the repaint
+        counters as well as the border width and color are needed. Thus a new bundle struct
+        DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
+        send the information at once.
+
 2017-05-09  Yusuke Suzuki  <utatane....@gmail.com>
 
         Handle IDLPromise<> properly

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (216501 => 216502)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2017-05-09 12:38:43 UTC (rev 216502)
@@ -3,6 +3,7 @@
  Copyright (C) 2010 Apple Inc. All rights reserved.
  Copyright (C) 2012 Company 100, Inc.
  Copyright (C) 2012 Intel Corporation. All rights reserved.
+ Copyright (C) 2017 Sony Interactive Entertainment Inc.
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Library General Public
@@ -447,8 +448,8 @@
         return;
 
     GraphicsLayer::setShowDebugBorder(show);
-    m_layerState.showDebugBorders = true;
-    m_layerState.flagsChanged = true;
+    m_layerState.debugVisuals.showDebugBorders = show;
+    m_layerState.debugVisualsChanged = true;
 
     didChangeLayerState();
 }
@@ -459,8 +460,8 @@
         return;
 
     GraphicsLayer::setShowRepaintCounter(show);
-    m_layerState.showRepaintCounter = true;
-    m_layerState.flagsChanged = true;
+    m_layerState.debugVisuals.showRepaintCounter = show;
+    m_layerState.debugVisualsChanged = true;
 
     didChangeLayerState();
 }
@@ -661,26 +662,29 @@
         m_layerState.masksToBounds = masksToBounds();
         m_layerState.preserves3D = preserves3D();
         m_layerState.fixedToViewport = fixedToViewport();
-        m_layerState.showDebugBorders = isShowingDebugBorder();
-        m_layerState.showRepaintCounter = isShowingRepaintCounter();
         m_layerState.isScrollable = isScrollable();
     }
 
-    if (m_layerState.showDebugBorders)
+    if (m_layerState.debugVisualsChanged) {
+        m_layerState.debugVisuals.showDebugBorders = isShowingDebugBorder();
+        m_layerState.debugVisuals.showRepaintCounter = isShowingRepaintCounter();
+    }
+
+    if (m_layerState.debugVisuals.showDebugBorders)
         updateDebugIndicators();
 }
 
 void CoordinatedGraphicsLayer::setDebugBorder(const Color& color, float width)
 {
-    ASSERT(m_layerState.showDebugBorders);
-    if (m_layerState.debugBorderColor != color) {
-        m_layerState.debugBorderColor = color;
-        m_layerState.debugBorderColorChanged = true;
+    ASSERT(m_layerState.debugVisuals.showDebugBorders);
+    if (m_layerState.debugVisuals.debugBorderColor != color) {
+        m_layerState.debugVisuals.debugBorderColor = color;
+        m_layerState.debugVisualsChanged = true;
     }
 
-    if (m_layerState.debugBorderWidth != width) {
-        m_layerState.debugBorderWidth = width;
-        m_layerState.debugBorderWidthChanged = true;
+    if (m_layerState.debugVisuals.debugBorderWidth != width) {
+        m_layerState.debugVisuals.debugBorderWidth = width;
+        m_layerState.debugVisualsChanged = true;
     }
 }
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h (216501 => 216502)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h	2017-05-09 12:38:43 UTC (rev 216502)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2013 Company 100, Inc. All rights reserved.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -64,6 +65,21 @@
     float scale;
 };
 
+struct DebugVisuals {
+    DebugVisuals()
+        : showDebugBorders(false)
+        , showRepaintCounter(false) { }
+    Color debugBorderColor;
+    float debugBorderWidth { 0 };
+    union {
+        struct {
+            bool showDebugBorders : 1;
+            bool showRepaintCounter : 1;
+        };
+        unsigned flags;
+    };
+};
+
 struct CoordinatedGraphicsLayerState {
     union {
         struct {
@@ -75,8 +91,7 @@
             bool contentsRectChanged: 1;
             bool opacityChanged: 1;
             bool solidColorChanged: 1;
-            bool debugBorderColorChanged: 1;
-            bool debugBorderWidthChanged: 1;
+            bool debugVisualsChanged: 1;
             bool replicaChanged: 1;
             bool maskChanged: 1;
             bool imageChanged: 1;
@@ -103,8 +118,6 @@
             bool masksToBounds : 1;
             bool preserves3D : 1;
             bool fixedToViewport : 1;
-            bool showDebugBorders : 1;
-            bool showRepaintCounter : 1;
             bool isScrollable: 1;
         };
         unsigned flags;
@@ -119,11 +132,8 @@
         , masksToBounds(false)
         , preserves3D(false)
         , fixedToViewport(false)
-        , showDebugBorders(false)
-        , showRepaintCounter(false)
         , isScrollable(false)
         , opacity(0)
-        , debugBorderWidth(0)
         , replica(InvalidCoordinatedLayerID)
         , mask(InvalidCoordinatedLayerID)
         , imageID(InvalidCoordinatedImageBackingID)
@@ -144,8 +154,6 @@
     FloatSize contentsTileSize;
     float opacity;
     Color solidColor;
-    Color debugBorderColor;
-    float debugBorderWidth;
     FilterOperations filters;
     TextureMapperAnimations animations;
     Vector<uint32_t> children;
@@ -154,6 +162,7 @@
     CoordinatedLayerID replica;
     CoordinatedLayerID mask;
     CoordinatedImageBackingID imageID;
+    DebugVisuals debugVisuals;
 
     unsigned repaintCount;
     Vector<TileUpdateInfo> tilesToUpdate;

Modified: trunk/Source/WebKit2/ChangeLog (216501 => 216502)


--- trunk/Source/WebKit2/ChangeLog	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-09 12:38:43 UTC (rev 216502)
@@ -1,3 +1,23 @@
+2017-05-09  Yoshiaki Jitsukawa  <yoshiaki.jitsuk...@sony.com>
+
+        [Coordinated Graphics] Debug Visuals don't hide
+        https://bugs.webkit.org/show_bug.cgi?id=162704
+
+        Reviewed by Žan Doberšek.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
+        (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
+        (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
+        (IPC::ArgumentCoder<DebugVisuals>::encode):
+        (IPC::ArgumentCoder<DebugVisuals>::decode):
+        The encoder and decoder for DebugVisuals have been added.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::setLayerState):
+        Update the debug visuals of a layer according to the DebugVisuals information
+        if the debugVisualsChanged flag is set to true.
+
 2017-05-09  Zan Dobersek  <zdober...@igalia.com>
 
         Upstream the WPE port

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp (216501 => 216502)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp	2017-05-09 12:38:43 UTC (rev 216502)
@@ -2,6 +2,7 @@
  * Copyright (C) 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2012 Company 100, Inc.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -645,12 +646,9 @@
     if (state.solidColorChanged)
         encoder << state.solidColor;
 
-    if (state.debugBorderColorChanged)
-        encoder << state.debugBorderColor;
+    if (state.debugVisualsChanged)
+        encoder << state.debugVisuals;
 
-    if (state.debugBorderWidthChanged)
-        encoder << state.debugBorderWidth;
-
     if (state.filtersChanged)
         encoder << state.filters;
 
@@ -720,12 +718,9 @@
     if (state.solidColorChanged && !decoder.decode(state.solidColor))
         return false;
 
-    if (state.debugBorderColorChanged && !decoder.decode(state.debugBorderColor))
+    if (state.debugVisualsChanged && !decoder.decode(state.debugVisuals))
         return false;
 
-    if (state.debugBorderWidthChanged && !decoder.decode(state.debugBorderWidth))
-        return false;
-
     if (state.filtersChanged && !decoder.decode(state.filters))
         return false;
 
@@ -915,6 +910,27 @@
     return true;
 }
 
+void ArgumentCoder<DebugVisuals>::encode(Encoder& encoder, const DebugVisuals& debugVisuals)
+{
+    encoder << debugVisuals.debugBorderColor;
+    encoder << debugVisuals.debugBorderWidth;
+    encoder << debugVisuals.flags;
+}
+
+bool ArgumentCoder<DebugVisuals>::decode(Decoder& decoder, DebugVisuals& debugVisuals)
+{
+    if (!decoder.decode(debugVisuals.debugBorderColor))
+        return false;
+
+    if (!decoder.decode(debugVisuals.debugBorderWidth))
+        return false;
+
+    if (!decoder.decode(debugVisuals.flags))
+        return false;
+
+    return true;
+}
+
 } // namespace IPC
 
 #endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h (216501 => 216502)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h	2017-05-09 12:38:43 UTC (rev 216502)
@@ -2,6 +2,7 @@
  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
  * Copyright (C) 2012 Company 100, Inc.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,6 +44,7 @@
 class TransformationMatrix;
 class TransformOperations;
 struct Length;
+struct DebugVisuals;
 
 class FilterOperations;
 }
@@ -94,6 +96,11 @@
     static bool decode(Decoder&, WebCore::CoordinatedGraphicsState&);
 };
 
+template<> struct ArgumentCoder<WebCore::DebugVisuals> {
+    static void encode(Encoder&, const WebCore::DebugVisuals&);
+    static bool decode(Decoder&, WebCore::DebugVisuals&);
+};
+
 } // namespace IPC
 
 #endif // USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (216501 => 216502)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-05-09 12:17:21 UTC (rev 216501)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-05-09 12:38:43 UTC (rev 216502)
@@ -1,6 +1,7 @@
 /*
     Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
     Copyright (C) 2012 Company 100, Inc.
+    Copyright (C) 2017 Sony Interactive Entertainment Inc.
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -232,8 +233,8 @@
     if (layerState.solidColorChanged)
         layer->setSolidColor(layerState.solidColor);
 
-    if (layerState.debugBorderColorChanged || layerState.debugBorderWidthChanged)
-        layer->setDebugVisuals(layerState.showDebugBorders, layerState.debugBorderColor, layerState.debugBorderWidth, layerState.showRepaintCounter);
+    if (layerState.debugVisualsChanged)
+        layer->setDebugVisuals(layerState.debugVisuals.showDebugBorders, layerState.debugVisuals.debugBorderColor, layerState.debugVisuals.debugBorderWidth, layerState.debugVisuals.showRepaintCounter);
 
     if (layerState.replicaChanged)
         layer->setReplicaLayer(getLayerByIDIfExists(layerState.replica));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to