Title: [295233] trunk/Source/WebCore/platform/graphics/texmap
Revision
295233
Author
[email protected]
Date
2022-06-03 14:12:12 -0700 (Fri, 03 Jun 2022)

Log Message

Remove TextureMapperLayer::setChildren(const Vector<GraphicsLayer*>&) to make TextureMapperLayer independent to GraphicsLayer and GraphicsLayerTextureMapper
https://bugs.webkit.org/show_bug.cgi?id=241248

Reviewed by Don Olmstead.

setChildren(const Vector<GraphicsLayer*>&) was taking GraphicsLayer
objects as an argument, and assuming the GraphicsLayer objects were
GraphicsLayerTextureMapper objects. This was a layer violation.
TextureMapperLayer doen't need to know about GraphicsLayer and
GraphicsLayerTextureMapper.

* Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp:
* Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h:

Canonical link: https://commits.webkit.org/251288@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (295232 => 295233)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2022-06-03 21:08:41 UTC (rev 295232)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2022-06-03 21:12:12 UTC (rev 295233)
@@ -417,10 +417,10 @@
         return;
 
     if (m_changeMask & ChildrenChange) {
-        Vector<GraphicsLayer*> rawChildren;
+        Vector<TextureMapperLayer*> rawChildren;
         rawChildren.reserveInitialCapacity(children().size());
-        for (auto& layer : children())
-            rawChildren.uncheckedAppend(layer.ptr());
+        for (auto& child : children())
+            rawChildren.uncheckedAppend(&downcast<GraphicsLayerTextureMapper>(child.get()).layer());
         m_layer.setChildren(rawChildren);
     }
 

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


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2022-06-03 21:08:41 UTC (rev 295232)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	2022-06-03 21:12:12 UTC (rev 295233)
@@ -21,7 +21,6 @@
 #include "TextureMapperLayer.h"
 
 #include "FloatQuad.h"
-#include "GraphicsLayerTextureMapper.h"
 #include "Region.h"
 #include <wtf/MathExtras.h>
 #include <wtf/SetForScope.h>
@@ -506,15 +505,6 @@
     paintUsingOverlapRegions(options);
 }
 
-#if !USE(COORDINATED_GRAPHICS)
-void TextureMapperLayer::setChildren(const Vector<GraphicsLayer*>& newChildren)
-{
-    removeAllChildren();
-    for (auto* child : newChildren)
-        addChild(&downcast<GraphicsLayerTextureMapper>(child)->layer());
-}
-#endif
-
 void TextureMapperLayer::setChildren(const Vector<TextureMapperLayer*>& newChildren)
 {
     removeAllChildren();

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


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	2022-06-03 21:08:41 UTC (rev 295232)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	2022-06-03 21:12:12 UTC (rev 295233)
@@ -32,7 +32,6 @@
 
 namespace WebCore {
 
-class GraphicsLayer;
 class Region;
 class TextureMapperPaintOptions;
 class TextureMapperPlatformLayer;
@@ -49,9 +48,6 @@
 
     const Vector<TextureMapperLayer*>& children() const { return m_children; }
 
-#if !USE(COORDINATED_GRAPHICS)
-    void setChildren(const Vector<GraphicsLayer*>&);
-#endif
     void setChildren(const Vector<TextureMapperLayer*>&);
     void setMaskLayer(TextureMapperLayer*);
     void setReplicaLayer(TextureMapperLayer*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to