[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2017 07:59:12 +0000 (07:59 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2017 07:59:12 +0000 (07:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168903

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the GraphicsContext pointer member from the TextureMapper class
since the getter and setter methods are not used anywhere.

* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::TextureMapper):
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::setGraphicsContext): Deleted.
(WebCore::TextureMapper::graphicsContext): Deleted.

Source/WebKit2:

Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
is not used anywhere. Also enables removing the GraphicsContext pointer
member from the TextureMapper class.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213035 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h

index 9d22268..845c48f 100644 (file)
@@ -1,3 +1,19 @@
+2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
+
+        [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
+        https://bugs.webkit.org/show_bug.cgi?id=168903
+
+        Reviewed by Carlos Garcia Campos.
+
+        Remove the GraphicsContext pointer member from the TextureMapper class
+        since the getter and setter methods are not used anywhere.
+
+        * platform/graphics/texmap/TextureMapper.cpp:
+        (WebCore::TextureMapper::TextureMapper):
+        * platform/graphics/texmap/TextureMapper.h:
+        (WebCore::TextureMapper::setGraphicsContext): Deleted.
+        (WebCore::TextureMapper::graphicsContext): Deleted.
+
 2017-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Stop compiling our own cursorMovementIterator()
index b985c7b..c076ec7 100644 (file)
@@ -41,8 +41,7 @@ std::unique_ptr<TextureMapper> TextureMapper::create()
 }
 
 TextureMapper::TextureMapper()
-    : m_context(0)
-    , m_interpolationQuality(InterpolationDefault)
+    : m_interpolationQuality(InterpolationDefault)
     , m_textDrawingMode(TextModeFill)
     , m_isMaskMode(false)
     , m_wrapMode(StretchWrap)
index 95105ec..a1ddd2d 100644 (file)
@@ -74,8 +74,6 @@ public:
 
     // makes a surface the target for the following drawTexture calls.
     virtual void bindSurface(BitmapTexture* surface) = 0;
-    void setGraphicsContext(GraphicsContext* context) { m_context = context; }
-    GraphicsContext* graphicsContext() { return m_context; }
     virtual void beginClip(const TransformationMatrix&, const FloatRect&) = 0;
     virtual void endClip() = 0;
     virtual IntRect clipBounds() = 0;
@@ -100,7 +98,6 @@ public:
     void setWrapMode(WrapMode m) { m_wrapMode = m; }
 
 protected:
-    GraphicsContext* m_context;
     std::unique_ptr<BitmapTexturePool> m_texturePool;
 
     bool isInMaskMode() const { return m_isMaskMode; }
index 375ca8d..cf6bb90 100644 (file)
@@ -1,3 +1,18 @@
+2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
+
+        [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
+        https://bugs.webkit.org/show_bug.cgi?id=168903
+
+        Reviewed by Carlos Garcia Campos.
+
+        Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
+        is not used anywhere. Also enables removing the GraphicsContext pointer
+        member from the TextureMapper class.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+
 2017-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Hangs when showing Google search results
index 1aca10e..b94faea 100644 (file)
@@ -125,32 +125,6 @@ void CoordinatedGraphicsScene::paintToCurrentGLContext(const TransformationMatri
         updateViewport();
 }
 
-void CoordinatedGraphicsScene::paintToGraphicsContext(PlatformGraphicsContext* platformContext, const Color& backgroundColor, bool drawsBackground)
-{
-    if (!m_textureMapper)
-        m_textureMapper = TextureMapper::create();
-    syncRemoteContent();
-    TextureMapperLayer* layer = rootLayer();
-
-    if (!layer)
-        return;
-
-    GraphicsContext graphicsContext(platformContext);
-    m_textureMapper->setGraphicsContext(&graphicsContext);
-    m_textureMapper->beginPainting();
-
-    IntRect clipRect = graphicsContext.clipBounds();
-    if (drawsBackground)
-        m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), backgroundColor);
-    else
-        m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), m_viewBackgroundColor);
-
-    layer->paint();
-    m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location());
-    m_textureMapper->endPainting();
-    m_textureMapper->setGraphicsContext(0);
-}
-
 void CoordinatedGraphicsScene::updateViewport()
 {
     if (!m_client)
index a46cb15..128b7be 100644 (file)
@@ -65,7 +65,6 @@ public:
     explicit CoordinatedGraphicsScene(CoordinatedGraphicsSceneClient*);
     virtual ~CoordinatedGraphicsScene();
     void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, const WebCore::Color& backgroundColor, bool drawsBackground, const WebCore::FloatPoint&, WebCore::TextureMapper::PaintFlags = 0);
-    void paintToGraphicsContext(PlatformGraphicsContext*, const WebCore::Color& backgroundColor, bool drawsBackground);
     void detach();
     void appendUpdate(std::function<void()>&&);