[CoordinatedGraphics] Merge CoordinatedTile into Tile
authorryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jun 2015 00:03:35 +0000 (00:03 +0000)
committerryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jun 2015 00:03:35 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145602

Reviewed by Darin Adler.

CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
So, there is no reason that CoordinatedTile inherits Tile interface.

No new tests, no behavior changes.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
* platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
(WebCore::CoordinatedTile::coordinate): Deleted.
(WebCore::CoordinatedTile::rect): Deleted.
* platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
* platform/graphics/texmap/coordinated/Tile.h:
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::createTiles):

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

Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h [deleted file]
Source/WebCore/platform/graphics/texmap/coordinated/Tile.cpp [moved from Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.cpp with 59% similarity]
Source/WebCore/platform/graphics/texmap/coordinated/Tile.h
Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp

index 1f9bad5..a760bfa 100644 (file)
@@ -1,3 +1,30 @@
+2015-06-03  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        [CoordinatedGraphics] Merge CoordinatedTile into Tile
+        https://bugs.webkit.org/show_bug.cgi?id=145602
+
+        Reviewed by Darin Adler.
+
+        CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
+        So, there is no reason that CoordinatedTile inherits Tile interface.
+
+        No new tests, no behavior changes.
+
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
+        * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
+        (WebCore::CoordinatedTile::coordinate): Deleted.
+        (WebCore::CoordinatedTile::rect): Deleted.
+        * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
+        * platform/graphics/texmap/coordinated/Tile.h:
+        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::createTiles):
+
 2015-06-03  Matt Rajca  <mrajca@apple.com>
 
         Add basic Media Session support to HTMLMediaElement.
index ed02fe1..1830192 100644 (file)
@@ -192,7 +192,7 @@ list(APPEND WebCore_SOURCES
     platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
     platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
     platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
-    platform/graphics/texmap/coordinated/CoordinatedTile.cpp
+    platform/graphics/texmap/coordinated/Tile.cpp
     platform/graphics/texmap/coordinated/TiledBackingStore.cpp
     platform/graphics/texmap/coordinated/UpdateAtlas.cpp
 
index b26092d..70d849a 100644 (file)
@@ -413,7 +413,7 @@ if (ENABLE_THREADED_COMPOSITOR)
         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
         platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
         platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
-        platform/graphics/texmap/coordinated/CoordinatedTile.cpp
+        platform/graphics/texmap/coordinated/Tile.cpp
         platform/graphics/texmap/coordinated/TiledBackingStore.cpp
         platform/graphics/texmap/coordinated/UpdateAtlas.cpp
     )
index 92b9b3f..689bc54 100644 (file)
     <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedGraphicsLayer.cpp" />
     <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedImageBacking.cpp" />
     <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedSurface.cpp" />
-    <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedTile.cpp" />
+    <ClCompile Include="..\platform\graphics\texmap\coordinated\Tile.cpp" />
     <ClCompile Include="..\platform\graphics\texmap\coordinated\UpdateAtlas.cpp" />
     <ClCompile Include="..\platform\graphics\texmap\GraphicsLayerTextureMapper.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
     <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedGraphicsState.h" />
     <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedImageBacking.h" />
     <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedSurface.h" />
-    <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedTile.h" />
     <ClInclude Include="..\platform\graphics\texmap\coordinated\SurfaceUpdateInfo.h" />
+    <ClInclude Include="..\platform\graphics\texmap\coordinated\Tile.h" />
     <ClInclude Include="..\platform\graphics\texmap\coordinated\UpdateAtlas.h" />
     <ClInclude Include="..\platform\graphics\texmap\GraphicsLayerTextureMapper.h" />
     <ClInclude Include="..\platform\graphics\texmap\TextureMapper.h" />
index 349a69e..28b0001 100644 (file)
     <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedSurface.cpp">
       <Filter>platform\graphics\texmap\coordinated</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\texmap\coordinated\CoordinatedTile.cpp">
+    <ClCompile Include="..\platform\graphics\texmap\coordinated\Tile.cpp">
       <Filter>platform\graphics\texmap\coordinated</Filter>
     </ClCompile>
     <ClCompile Include="..\platform\graphics\texmap\coordinated\UpdateAtlas.cpp">
     <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedSurface.h">
       <Filter>platform\graphics\texmap\coordinated</Filter>
     </ClInclude>
-    <ClInclude Include="..\platform\graphics\texmap\coordinated\CoordinatedTile.h">
+    <ClInclude Include="..\platform\graphics\texmap\coordinated\SurfaceUpdateInfo.h">
       <Filter>platform\graphics\texmap\coordinated</Filter>
     </ClInclude>
-    <ClInclude Include="..\platform\graphics\texmap\coordinated\SurfaceUpdateInfo.h">
+    <ClInclude Include="..\platform\graphics\texmap\coordinated\Tile.h">
       <Filter>platform\graphics\texmap\coordinated</Filter>
     </ClInclude>
     <ClInclude Include="..\platform\graphics\texmap\coordinated\UpdateAtlas.h">
index 618d8bb..1fb5b9e 100644 (file)
@@ -25,7 +25,6 @@
 #if USE(COORDINATED_GRAPHICS)
 #include "CoordinatedGraphicsLayer.h"
 
-#include "CoordinatedTile.h"
 #include "FloatQuad.h"
 #include "Frame.h"
 #include "FrameView.h"
index 917bafd..1a86f59 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "CoordinatedGraphicsState.h"
 #include "CoordinatedImageBacking.h"
-#include "CoordinatedTile.h"
 #include "FloatPoint3D.h"
 #include "GraphicsLayer.h"
 #include "GraphicsLayerTransform.h"
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedTile.h
deleted file mode 100644 (file)
index 9a80e9a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CoordinatedTile_h
-#define CoordinatedTile_h
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "CoordinatedSurface.h"
-#include "IntRect.h"
-#include "Tile.h"
-#include "TiledBackingStore.h"
-
-namespace WebCore {
-
-class ImageBuffer;
-class TiledBackingStore;
-
-class CoordinatedTile : public Tile, public CoordinatedSurface::Client {
-public:
-    static PassRefPtr<Tile> create(TiledBackingStore*, const Coordinate&);
-
-    ~CoordinatedTile();
-
-    bool isDirty() const;
-    void invalidate(const IntRect&);
-    bool updateBackBuffer();
-    bool isReadyToPaint() const;
-    void paint(GraphicsContext*, const IntRect&);
-
-    const Coordinate& coordinate() const { return m_coordinate; }
-    const IntRect& rect() const { return m_rect; }
-    void resize(const IntSize&);
-
-    virtual void paintToSurfaceContext(GraphicsContext*) override;
-
-private:
-    CoordinatedTile(TiledBackingStore*, const Coordinate&);
-
-    TiledBackingStore* m_tiledBackingStore;
-    Coordinate m_coordinate;
-    IntRect m_rect;
-
-    uint32_t m_ID;
-    IntRect m_dirtyRect;
-};
-
-} // namespace WebCore
-
-#endif // USE(COORDINATED_GRAPHICS)
-
-#endif // CoordinatedTile_h
  */
 
 #include "config.h"
-#include "CoordinatedTile.h"
+#include "Tile.h"
 
 #if USE(COORDINATED_GRAPHICS)
-
 #include "GraphicsContext.h"
-#include "ImageBuffer.h"
 #include "SurfaceUpdateInfo.h"
+#include "TiledBackingStore.h"
 #include "TiledBackingStoreClient.h"
 
 namespace WebCore {
 
-static const uint32_t InvalidCoordinatedTileID = 0;
+static const uint32_t InvalidTileID = 0;
 
-PassRefPtr<Tile> CoordinatedTile::create(TiledBackingStore* tiledBackingStore, const Coordinate& tileCoordinate)
+PassRefPtr<Tile> Tile::create(TiledBackingStore& tiledBackingStore, const Coordinate& tileCoordinate)
 {
-    return adoptRef(new CoordinatedTile(tiledBackingStore, tileCoordinate));
+    return adoptRef(new Tile(tiledBackingStore, tileCoordinate));
 }
 
-CoordinatedTile::CoordinatedTile(TiledBackingStore* tiledBackingStore, const Coordinate& tileCoordinate)
+Tile::Tile(TiledBackingStore& tiledBackingStore, const Coordinate& tileCoordinate)
     : m_tiledBackingStore(tiledBackingStore)
     , m_coordinate(tileCoordinate)
-    , m_rect(tiledBackingStore->tileRectForCoordinate(tileCoordinate))
-    , m_ID(InvalidCoordinatedTileID)
+    , m_rect(tiledBackingStore.tileRectForCoordinate(tileCoordinate))
+    , m_ID(InvalidTileID)
     , m_dirtyRect(m_rect)
 {
 }
 
-CoordinatedTile::~CoordinatedTile()
+Tile::~Tile()
 {
-    if (m_ID != InvalidCoordinatedTileID)
-        m_tiledBackingStore->client()->removeTile(m_ID);
+    if (m_ID != InvalidTileID)
+        m_tiledBackingStore.client()->removeTile(m_ID);
 }
 
-bool CoordinatedTile::isDirty() const
+bool Tile::isDirty() const
 {
     return !m_dirtyRect.isEmpty();
 }
 
-void CoordinatedTile::invalidate(const IntRect& dirtyRect)
+void Tile::invalidate(const IntRect& dirtyRect)
 {
     IntRect tileDirtyRect = intersection(dirtyRect, m_rect);
     if (tileDirtyRect.isEmpty())
@@ -71,52 +70,47 @@ void CoordinatedTile::invalidate(const IntRect& dirtyRect)
     m_dirtyRect.unite(tileDirtyRect);
 }
 
-bool CoordinatedTile::updateBackBuffer()
+bool Tile::updateBackBuffer()
 {
     if (!isDirty())
         return false;
 
     SurfaceUpdateInfo updateInfo;
 
-    if (!m_tiledBackingStore->client()->paintToSurface(m_dirtyRect.size(), updateInfo.atlasID, updateInfo.surfaceOffset, this))
+    if (!m_tiledBackingStore.client()->paintToSurface(m_dirtyRect.size(), updateInfo.atlasID, updateInfo.surfaceOffset, this))
         return false;
 
     updateInfo.updateRect = m_dirtyRect;
     updateInfo.updateRect.move(-m_rect.x(), -m_rect.y());
 
     static uint32_t id = 1;
-    if (m_ID == InvalidCoordinatedTileID) {
+    if (m_ID == InvalidTileID) {
         m_ID = id++;
         // We may get an invalid ID due to wrap-around on overflow.
-        if (m_ID == InvalidCoordinatedTileID)
+        if (m_ID == InvalidTileID)
             m_ID = id++;
-        m_tiledBackingStore->client()->createTile(m_ID, m_tiledBackingStore->contentsScale());
+        m_tiledBackingStore.client()->createTile(m_ID, m_tiledBackingStore.contentsScale());
     }
-    m_tiledBackingStore->client()->updateTile(m_ID, updateInfo, m_rect);
+    m_tiledBackingStore.client()->updateTile(m_ID, updateInfo, m_rect);
 
     m_dirtyRect = IntRect();
 
     return true;
 }
 
-void CoordinatedTile::paintToSurfaceContext(GraphicsContext* context)
+void Tile::paintToSurfaceContext(GraphicsContext* context)
 {
     context->translate(-m_dirtyRect.x(), -m_dirtyRect.y());
-    context->scale(FloatSize(m_tiledBackingStore->contentsScale(), m_tiledBackingStore->contentsScale()));
-    m_tiledBackingStore->client()->tiledBackingStorePaint(context, m_tiledBackingStore->mapToContents(m_dirtyRect));
-}
-
-bool CoordinatedTile::isReadyToPaint() const
-{
-    return m_ID != InvalidCoordinatedTileID;
+    context->scale(FloatSize(m_tiledBackingStore.contentsScale(), m_tiledBackingStore.contentsScale()));
+    m_tiledBackingStore.client()->tiledBackingStorePaint(context, m_tiledBackingStore.mapToContents(m_dirtyRect));
 }
 
-void CoordinatedTile::paint(GraphicsContext*, const IntRect&)
+bool Tile::isReadyToPaint() const
 {
-    ASSERT_NOT_REACHED();
+    return m_ID != InvalidTileID;
 }
 
-void CoordinatedTile::resize(const IntSize& newSize)
+void Tile::resize(const IntSize& newSize)
 {
     m_rect = IntRect(m_rect.location(), newSize);
     m_dirtyRect = m_rect;
index 94e51d4..a34b220 100644 (file)
@@ -1,54 +1,75 @@
 /*
- Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Library General Public License for more details.
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB.  If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef Tile_h
 #define Tile_h
 
 #if USE(COORDINATED_GRAPHICS)
-
+#include "CoordinatedSurface.h"
 #include "IntPoint.h"
 #include "IntPointHash.h"
 #include "IntRect.h"
 #include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
 
 namespace WebCore {
 
 class GraphicsContext;
+class TiledBackingStore;
 
-class Tile : public RefCounted<Tile> {
+class Tile : public RefCounted<Tile>, public CoordinatedSurface::Client {
 public:
     typedef IntPoint Coordinate;
 
-    virtual ~Tile() { }
+    static PassRefPtr<Tile> create(TiledBackingStore&, const Coordinate&);
+
+    ~Tile();
+
+    bool isDirty() const;
+    void invalidate(const IntRect&);
+    bool updateBackBuffer();
+    bool isReadyToPaint() const;
+
+    const Coordinate& coordinate() const { return m_coordinate; }
+    const IntRect& rect() const { return m_rect; }
+    void resize(const IntSize&);
 
-    virtual bool isDirty() const = 0;
-    virtual void invalidate(const IntRect&) = 0;
-    virtual bool updateBackBuffer() = 0;
-    virtual bool isReadyToPaint() const = 0;
-    virtual void paint(GraphicsContext*, const IntRect&) = 0;
+    virtual void paintToSurfaceContext(GraphicsContext*) override;
 
-    virtual const Tile::Coordinate& coordinate() const = 0;
-    virtual const IntRect& rect() const = 0;
-    virtual void resize(const WebCore::IntSize&) = 0;
+private:
+    Tile(TiledBackingStore&, const Coordinate&);
+
+    TiledBackingStore& m_tiledBackingStore;
+    Coordinate m_coordinate;
+    IntRect m_rect;
+
+    uint32_t m_ID;
+    IntRect m_dirtyRect;
 };
 
-}
-#endif
-#endif
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif // Tile_h
index 1574991..92d27e6 100644 (file)
@@ -21,8 +21,6 @@
 #include "TiledBackingStore.h"
 
 #if USE(COORDINATED_GRAPHICS)
-
-#include "CoordinatedTile.h"
 #include "GraphicsContext.h"
 #include "TiledBackingStoreClient.h"
 
@@ -256,7 +254,7 @@ void TiledBackingStore::createTiles()
     unsigned tilesToCreateCount = tilesToCreate.size();
     for (unsigned n = 0; n < tilesToCreateCount; ++n) {
         Tile::Coordinate coordinate = tilesToCreate[n];
-        setTile(coordinate, CoordinatedTile::create(this, coordinate));
+        setTile(coordinate, Tile::create(*this, coordinate));
     }
     requiredTileCount -= tilesToCreateCount;