Title: [220391] trunk/Source
Revision
220391
Author
zandober...@gmail.com
Date
2017-08-08 00:44:44 -0700 (Tue, 08 Aug 2017)

Log Message

[TexMap] Don't expose GraphicsContext3D object
https://bugs.webkit.org/show_bug.cgi?id=175310

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
class which was accessing the GraphicsContext3D object for this purpose.

* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::clearColor):
* platform/graphics/texmap/TextureMapperGL.h:
(WebCore::TextureMapperGL::graphicsContext3D const): Deleted.

Source/WebKit:

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
Stop using GraphicsContext3D directly and instead use the
TextureMapper::clearColor() method to achieve the same result.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (220390 => 220391)


--- trunk/Source/WebCore/ChangeLog	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebCore/ChangeLog	2017-08-08 07:44:44 UTC (rev 220391)
@@ -1,3 +1,20 @@
+2017-08-08  Zan Dobersek  <zdober...@igalia.com>
+
+        [TexMap] Don't expose GraphicsContext3D object
+        https://bugs.webkit.org/show_bug.cgi?id=175310
+
+        Reviewed by Carlos Garcia Campos.
+
+        Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
+        the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
+        class which was accessing the GraphicsContext3D object for this purpose.
+
+        * platform/graphics/texmap/TextureMapper.h:
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::clearColor):
+        * platform/graphics/texmap/TextureMapperGL.h:
+        (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.
+
 2017-08-07  Simon Fraser  <simon.fra...@apple.com>
 
         RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h (220390 => 220391)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h	2017-08-08 07:44:44 UTC (rev 220391)
@@ -72,6 +72,7 @@
 
     virtual void drawTexture(const BitmapTexture&, const FloatRect& target, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0f, unsigned exposedEdges = AllEdges) = 0;
     virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) = 0;
+    virtual void clearColor(const Color&) = 0;
 
     // makes a surface the target for the following drawTexture calls.
     virtual void bindSurface(BitmapTexture* surface) = 0;

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (220390 => 220391)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2017-08-08 07:44:44 UTC (rev 220391)
@@ -508,6 +508,12 @@
     draw(rect, matrix, program.get(), GraphicsContext3D::TRIANGLE_FAN, flags);
 }
 
+void TextureMapperGL::clearColor(const Color& color)
+{
+    m_context3D->clearColor(color.red() / 255.0f, color.green() / 255.0f, color.blue() / 255.0f, color.alpha() / 255.0f);
+    m_context3D->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+}
+
 void TextureMapperGL::drawEdgeTriangles(TextureMapperShaderProgram& program)
 {
     const GC3Dfloat left = 0;

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h (220390 => 220391)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h	2017-08-08 07:44:44 UTC (rev 220391)
@@ -62,6 +62,7 @@
     void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, unsigned exposedEdges) override;
     virtual void drawTexture(Platform3DObject texture, Flags, const IntSize& textureSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, unsigned exposedEdges = AllEdges);
     void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) override;
+    void clearColor(const Color&) override;
 
     void bindSurface(BitmapTexture* surface) override;
     BitmapTexture* currentSurface();
@@ -73,7 +74,6 @@
     IntSize maxTextureSize() const override { return IntSize(2000, 2000); }
     Ref<BitmapTexture> createTexture() override { return createTexture(GraphicsContext3D::DONT_CARE); }
     Ref<BitmapTexture> createTexture(GC3Dint internalFormat) override;
-    inline GraphicsContext3D* graphicsContext3D() const { return m_context3D.get(); }
 
     void drawFiltered(const BitmapTexture& sourceTexture, const BitmapTexture* contentTexture, const FilterOperation&, int pass);
 

Modified: trunk/Source/WebKit/ChangeLog (220390 => 220391)


--- trunk/Source/WebKit/ChangeLog	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebKit/ChangeLog	2017-08-08 07:44:44 UTC (rev 220391)
@@ -1,3 +1,15 @@
+2017-08-08  Zan Dobersek  <zdober...@igalia.com>
+
+        [TexMap] Don't expose GraphicsContext3D object
+        https://bugs.webkit.org/show_bug.cgi?id=175310
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
+        Stop using GraphicsContext3D directly and instead use the
+        TextureMapper::clearColor() method to achieve the same result.
+
 2017-08-07  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Implement _javascript_ dialog methods of API::AutomationSessionClient

Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (220390 => 220391)


--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-08-08 07:29:26 UTC (rev 220390)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-08-08 07:44:44 UTC (rev 220391)
@@ -106,11 +106,8 @@
             backgroundColor.green(), backgroundColor.blue(),
             backgroundColor.alpha() * opacity);
         m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), Color(rgba));
-    } else {
-        GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
-        context->clearColor(m_viewBackgroundColor.red() / 255.0f, m_viewBackgroundColor.green() / 255.0f, m_viewBackgroundColor.blue() / 255.0f, m_viewBackgroundColor.alpha() / 255.0f);
-        context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
-    }
+    } else
+        m_textureMapper->clearColor(m_viewBackgroundColor);
 
     if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
         currentRootLayer->setOpacity(opacity);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to