Title: [229670] trunk/Source/WebCore
Revision
229670
Author
zandober...@gmail.com
Date
2018-03-16 10:07:26 -0700 (Fri, 16 Mar 2018)

Log Message

[TexMap] Clean up TextureMapperLayer constructor
https://bugs.webkit.org/show_bug.cgi?id=183634

Reviewed by Michael Catanzaro.

In the TextureMapperLayer header, only declare the constructor, and move
all the previous member initialization to the point of declaration of
these member variables.

In the TextureMapperLayer implementation file, the constructor and
destructor are moved into proper order at the top of the file. The
former is defaulted, and the latter remains unchanged.

No change in behavior.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
* platform/graphics/texmap/TextureMapperLayer.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (229669 => 229670)


--- trunk/Source/WebCore/ChangeLog	2018-03-16 17:06:03 UTC (rev 229669)
+++ trunk/Source/WebCore/ChangeLog	2018-03-16 17:07:26 UTC (rev 229670)
@@ -1,3 +1,24 @@
+2018-03-16  Zan Dobersek  <zdober...@igalia.com>
+
+        [TexMap] Clean up TextureMapperLayer constructor
+        https://bugs.webkit.org/show_bug.cgi?id=183634
+
+        Reviewed by Michael Catanzaro.
+
+        In the TextureMapperLayer header, only declare the constructor, and move
+        all the previous member initialization to the point of declaration of
+        these member variables.
+
+        In the TextureMapperLayer implementation file, the constructor and
+        destructor are moved into proper order at the top of the file. The
+        former is defaulted, and the latter remains unchanged.
+
+        No change in behavior.
+
+        * platform/graphics/texmap/TextureMapperLayer.cpp:
+        (WebCore::TextureMapperLayer::~TextureMapperLayer):
+        * platform/graphics/texmap/TextureMapperLayer.h:
+
 2018-03-16  Miguel Gomez  <mago...@igalia.com>
 
         [GTK] When using EGL, request an OpenGL core profile when possible

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (229669 => 229670)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2018-03-16 17:06:03 UTC (rev 229669)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2018-03-16 17:07:26 UTC (rev 229670)
@@ -40,6 +40,23 @@
     IntSize offset;
 };
 
+TextureMapperLayer::TextureMapperLayer() = default;
+
+TextureMapperLayer::~TextureMapperLayer()
+{
+    for (auto* child : m_children)
+        child->m_parent = nullptr;
+
+    removeFromParent();
+
+    if (m_effectTarget) {
+        if (m_effectTarget->m_state.maskLayer == this)
+            m_effectTarget->m_state.maskLayer = nullptr;
+        if (m_effectTarget->m_state.replicaLayer == this)
+            m_effectTarget->m_state.replicaLayer = nullptr;
+    }
+}
+
 void TextureMapperLayer::computeTransformsRecursive()
 {
     if (m_state.size.isEmpty() && m_state.masksToBounds)
@@ -419,21 +436,6 @@
     paintUsingOverlapRegions(paintOptions);
 }
 
-TextureMapperLayer::~TextureMapperLayer()
-{
-    for (auto* child : m_children)
-        child->m_parent = nullptr;
-
-    removeFromParent();
-
-    if (m_effectTarget) {
-        if (m_effectTarget->m_state.maskLayer == this)
-            m_effectTarget->m_state.maskLayer = nullptr;
-        if (m_effectTarget->m_state.replicaLayer == this)
-            m_effectTarget->m_state.replicaLayer = nullptr;
-    }
-}
-
 #if !USE(COORDINATED_GRAPHICS)
 void TextureMapperLayer::setChildren(const Vector<GraphicsLayer*>& newChildren)
 {

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h (229669 => 229670)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	2018-03-16 17:06:03 UTC (rev 229669)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	2018-03-16 17:07:26 UTC (rev 229670)
@@ -38,17 +38,7 @@
     WTF_MAKE_NONCOPYABLE(TextureMapperLayer);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    TextureMapperLayer()
-        : m_parent(0)
-        , m_effectTarget(0)
-        , m_contentsLayer(0)
-        , m_currentOpacity(1)
-        , m_centerZ(0)
-        , m_textureMapper(0)
-        , m_fixedToViewport(false)
-        , m_id(0)
-    { }
-
+    WEBCORE_EXPORT TextureMapperLayer();
     virtual ~TextureMapperLayer();
 
     void setID(uint32_t id) { m_id = id; }
@@ -156,14 +146,14 @@
     }
 
     Vector<TextureMapperLayer*> m_children;
-    TextureMapperLayer* m_parent;
-    TextureMapperLayer* m_effectTarget;
+    TextureMapperLayer* m_parent { nullptr };
+    TextureMapperLayer* m_effectTarget { nullptr };
     RefPtr<TextureMapperBackingStore> m_backingStore;
-    TextureMapperPlatformLayer* m_contentsLayer;
     GraphicsLayerTransform m_currentTransform;
-    float m_currentOpacity;
+    TextureMapperPlatformLayer* m_contentsLayer { nullptr };
+    float m_currentOpacity { 1.0 };
     FilterOperations m_currentFilters;
-    float m_centerZ;
+    float m_centerZ { 0 };
 
     struct State {
         FloatPoint pos;
@@ -213,11 +203,11 @@
     };
 
     State m_state;
-    TextureMapper* m_textureMapper;
+    TextureMapper* m_textureMapper { nullptr };
     TextureMapperAnimations m_animations;
     FloatSize m_scrollPositionDelta;
-    bool m_fixedToViewport;
-    uint32_t m_id;
+    bool m_fixedToViewport { false };
+    uint32_t m_id { 0 };
 };
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to