[Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2016 07:32:32 +0000 (07:32 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2016 07:32:32 +0000 (07:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159209

Reviewed by Žan Doberšek.

Source/WebCore:

Remove CompositingCoordinator and its helper classes from the platform layer.

* platform/TextureMapper.cmake:

Source/WebKit2:

Move CompositingCoordinator and its helper classes to the WebKit2 layer.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp.
(WebKit::AreaAllocator::AreaAllocator):
(WebKit::AreaAllocator::~AreaAllocator):
(WebKit::AreaAllocator::expand):
(WebKit::AreaAllocator::expandBy):
(WebKit::AreaAllocator::release):
(WebKit::AreaAllocator::overhead):
(WebKit::AreaAllocator::roundAllocation):
(WebKit::GeneralAreaAllocator::GeneralAreaAllocator):
(WebKit::GeneralAreaAllocator::~GeneralAreaAllocator):
(WebKit::GeneralAreaAllocator::freeNode):
(WebKit::GeneralAreaAllocator::expand):
(WebKit::fitsWithin):
(WebKit::GeneralAreaAllocator::allocate):
(WebKit::GeneralAreaAllocator::allocateFromNode):
(WebKit::GeneralAreaAllocator::splitNode):
(WebKit::GeneralAreaAllocator::updateLargestFree):
(WebKit::GeneralAreaAllocator::release):
(WebKit::GeneralAreaAllocator::overhead):
* WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h.
(WebKit::nextPowerOfTwo):
(WebKit::AreaAllocator::size):
(WebKit::AreaAllocator::minimumAllocation):
(WebKit::AreaAllocator::setMinimumAllocation):
(WebKit::AreaAllocator::margin):
(WebKit::AreaAllocator::setMargin):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp.
(WebKit::CompositingCoordinator::CompositingCoordinator):
(WebKit::CompositingCoordinator::~CompositingCoordinator):
(WebKit::CompositingCoordinator::setRootCompositingLayer):
(WebKit::CompositingCoordinator::setViewOverlayRootLayer):
(WebKit::CompositingCoordinator::sizeDidChange):
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::timestamp):
(WebKit::CompositingCoordinator::syncDisplayState):
(WebKit::CompositingCoordinator::nextAnimationServiceTime):
(WebKit::CompositingCoordinator::clearPendingStateChanges):
(WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
(WebKit::CompositingCoordinator::createRootLayer):
(WebKit::CompositingCoordinator::syncLayerState):
(WebKit::CompositingCoordinator::createImageBackingIfNeeded):
(WebKit::CompositingCoordinator::createImageBacking):
(WebKit::CompositingCoordinator::updateImageBacking):
(WebKit::CompositingCoordinator::clearImageBackingContents):
(WebKit::CompositingCoordinator::removeImageBacking):
(WebKit::CompositingCoordinator::flushPendingImageBackingChanges):
(WebKit::CompositingCoordinator::notifyAnimationStarted):
(WebKit::CompositingCoordinator::notifyFlushRequired):
(WebKit::CompositingCoordinator::paintContents):
(WebKit::CompositingCoordinator::createGraphicsLayer):
(WebKit::CompositingCoordinator::deviceScaleFactor):
(WebKit::CompositingCoordinator::pageScaleFactor):
(WebKit::CompositingCoordinator::createUpdateAtlas):
(WebKit::CompositingCoordinator::removeUpdateAtlas):
(WebKit::CompositingCoordinator::visibleContentsRect):
(WebKit::CompositingCoordinator::mainContentsLayer):
(WebKit::CompositingCoordinator::setVisibleContentsRect):
(WebKit::CompositingCoordinator::deviceOrPageScaleFactorChanged):
(WebKit::CompositingCoordinator::detachLayer):
(WebKit::CompositingCoordinator::commitScrollOffset):
(WebKit::CompositingCoordinator::renderNextFrame):
(WebKit::CompositingCoordinator::purgeBackingStores):
(WebKit::CompositingCoordinator::paintToSurface):
(WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
(WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h.
(WebKit::CompositingCoordinator::clearRootLayer):
(WebKit::CompositingCoordinator::rootLayer):
(WebKit::CompositingCoordinator::state):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp.
(WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient):
(WebKit::UpdateAtlas::UpdateAtlas):
(WebKit::UpdateAtlas::~UpdateAtlas):
(WebKit::UpdateAtlas::buildLayoutIfNeeded):
(WebKit::UpdateAtlas::didSwapBuffers):
(WebKit::UpdateAtlas::paintOnAvailableBuffer):
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h.
(WebKit::UpdateAtlas::size):
(WebKit::UpdateAtlas::supportsAlpha):
(WebKit::UpdateAtlas::addTimeInactive):
(WebKit::UpdateAtlas::isInactive):
(WebKit::UpdateAtlas::isInUse):

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

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/TextureMapper.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp [moved from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp with 99% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h [moved from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h with 57% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp [moved from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp with 97% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h [moved from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h with 52% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp [moved from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp with 95% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h [moved from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h with 80% similarity]

index 4970710..d5a1165 100644 (file)
@@ -1,3 +1,14 @@
+2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
+        https://bugs.webkit.org/show_bug.cgi?id=159209
+
+        Reviewed by Žan Doberšek.
+
+        Remove CompositingCoordinator and its helper classes from the platform layer.
+
+        * platform/TextureMapper.cmake:
+
 2016-06-29  Youenn Fablet  <youenn@apple.com>
 
         Pass SecurityOrigin as references in CORS check code
index e190fa3..eb43a89 100644 (file)
@@ -33,14 +33,11 @@ if (USE_COORDINATED_GRAPHICS)
         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
         page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
 
-        platform/graphics/texmap/coordinated/AreaAllocator.cpp
-        platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
         platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
         platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
         platform/graphics/texmap/coordinated/CoordinatedSurface.cpp
         platform/graphics/texmap/coordinated/Tile.cpp
         platform/graphics/texmap/coordinated/TiledBackingStore.cpp
-        platform/graphics/texmap/coordinated/UpdateAtlas.cpp
     )
 endif ()
 
index 0c7215e..2129608 100644 (file)
@@ -1,3 +1,98 @@
+2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
+        https://bugs.webkit.org/show_bug.cgi?id=159209
+
+        Reviewed by Žan Doberšek.
+
+        Move CompositingCoordinator and its helper classes to the WebKit2 layer.
+
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp.
+        (WebKit::AreaAllocator::AreaAllocator):
+        (WebKit::AreaAllocator::~AreaAllocator):
+        (WebKit::AreaAllocator::expand):
+        (WebKit::AreaAllocator::expandBy):
+        (WebKit::AreaAllocator::release):
+        (WebKit::AreaAllocator::overhead):
+        (WebKit::AreaAllocator::roundAllocation):
+        (WebKit::GeneralAreaAllocator::GeneralAreaAllocator):
+        (WebKit::GeneralAreaAllocator::~GeneralAreaAllocator):
+        (WebKit::GeneralAreaAllocator::freeNode):
+        (WebKit::GeneralAreaAllocator::expand):
+        (WebKit::fitsWithin):
+        (WebKit::GeneralAreaAllocator::allocate):
+        (WebKit::GeneralAreaAllocator::allocateFromNode):
+        (WebKit::GeneralAreaAllocator::splitNode):
+        (WebKit::GeneralAreaAllocator::updateLargestFree):
+        (WebKit::GeneralAreaAllocator::release):
+        (WebKit::GeneralAreaAllocator::overhead):
+        * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h.
+        (WebKit::nextPowerOfTwo):
+        (WebKit::AreaAllocator::size):
+        (WebKit::AreaAllocator::minimumAllocation):
+        (WebKit::AreaAllocator::setMinimumAllocation):
+        (WebKit::AreaAllocator::margin):
+        (WebKit::AreaAllocator::setMargin):
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp.
+        (WebKit::CompositingCoordinator::CompositingCoordinator):
+        (WebKit::CompositingCoordinator::~CompositingCoordinator):
+        (WebKit::CompositingCoordinator::setRootCompositingLayer):
+        (WebKit::CompositingCoordinator::setViewOverlayRootLayer):
+        (WebKit::CompositingCoordinator::sizeDidChange):
+        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
+        (WebKit::CompositingCoordinator::timestamp):
+        (WebKit::CompositingCoordinator::syncDisplayState):
+        (WebKit::CompositingCoordinator::nextAnimationServiceTime):
+        (WebKit::CompositingCoordinator::clearPendingStateChanges):
+        (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
+        (WebKit::CompositingCoordinator::createRootLayer):
+        (WebKit::CompositingCoordinator::syncLayerState):
+        (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
+        (WebKit::CompositingCoordinator::createImageBacking):
+        (WebKit::CompositingCoordinator::updateImageBacking):
+        (WebKit::CompositingCoordinator::clearImageBackingContents):
+        (WebKit::CompositingCoordinator::removeImageBacking):
+        (WebKit::CompositingCoordinator::flushPendingImageBackingChanges):
+        (WebKit::CompositingCoordinator::notifyAnimationStarted):
+        (WebKit::CompositingCoordinator::notifyFlushRequired):
+        (WebKit::CompositingCoordinator::paintContents):
+        (WebKit::CompositingCoordinator::createGraphicsLayer):
+        (WebKit::CompositingCoordinator::deviceScaleFactor):
+        (WebKit::CompositingCoordinator::pageScaleFactor):
+        (WebKit::CompositingCoordinator::createUpdateAtlas):
+        (WebKit::CompositingCoordinator::removeUpdateAtlas):
+        (WebKit::CompositingCoordinator::visibleContentsRect):
+        (WebKit::CompositingCoordinator::mainContentsLayer):
+        (WebKit::CompositingCoordinator::setVisibleContentsRect):
+        (WebKit::CompositingCoordinator::deviceOrPageScaleFactorChanged):
+        (WebKit::CompositingCoordinator::detachLayer):
+        (WebKit::CompositingCoordinator::commitScrollOffset):
+        (WebKit::CompositingCoordinator::renderNextFrame):
+        (WebKit::CompositingCoordinator::purgeBackingStores):
+        (WebKit::CompositingCoordinator::paintToSurface):
+        (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
+        (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h.
+        (WebKit::CompositingCoordinator::clearRootLayer):
+        (WebKit::CompositingCoordinator::rootLayer):
+        (WebKit::CompositingCoordinator::state):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+        * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp.
+        (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient):
+        (WebKit::UpdateAtlas::UpdateAtlas):
+        (WebKit::UpdateAtlas::~UpdateAtlas):
+        (WebKit::UpdateAtlas::buildLayoutIfNeeded):
+        (WebKit::UpdateAtlas::didSwapBuffers):
+        (WebKit::UpdateAtlas::paintOnAvailableBuffer):
+        * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h.
+        (WebKit::UpdateAtlas::size):
+        (WebKit::UpdateAtlas::supportsAlpha):
+        (WebKit::UpdateAtlas::addTimeInactive):
+        (WebKit::UpdateAtlas::isInactive):
+        (WebKit::UpdateAtlas::isInUse):
+
 2016-06-29  Hunseop Jeong  <hs85.jeong@samsung.com>
 
         Unreviewed, CMake build fix.
index 242081c..dd763dd 100644 (file)
@@ -198,8 +198,11 @@ list(APPEND WebKit2_SOURCES
 
     WebProcess/WebPage/DrawingAreaImpl.cpp
 
+    WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
+    WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
+    WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp
     WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp
 
     WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
index 4f5591a..a7f4f7e 100644 (file)
@@ -826,8 +826,11 @@ if (ENABLE_THREADED_COMPOSITOR)
         Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
 
+        WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
+        WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
         WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
         WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
+        WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp
     )
     list(APPEND WebKit2_INCLUDE_DIRECTORIES
         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
  */
 
 #include "config.h"
+#include "AreaAllocator.h"
 
 #if USE(COORDINATED_GRAPHICS)
 
-#include "AreaAllocator.h"
+using namespace WebCore;
 
-namespace WebCore {
+namespace WebKit {
 
 AreaAllocator::AreaAllocator(const IntSize& size)
     : m_size(size)
@@ -330,6 +331,6 @@ int GeneralAreaAllocator::overhead() const
     return m_nodeCount * sizeof(Node);
 }
 
-} // namespace WebCore
+} // namespace WebKit
 
 #endif // USE(COORDINATED_GRAPHICS)
 #ifndef AreaAllocator_h
 #define AreaAllocator_h
 
-#include "IntPoint.h"
-#include "IntRect.h"
-#include "IntSize.h"
-
 #if USE(COORDINATED_GRAPHICS)
 
-namespace WebCore {
+#include <WebCore/IntPoint.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/IntSize.h>
+
+namespace WebKit {
 
 inline int nextPowerOfTwo(int number)
 {
@@ -41,58 +41,58 @@ inline int nextPowerOfTwo(int number)
     return number;
 }
 
-inline IntSize nextPowerOfTwo(const IntSize& size)
+inline WebCore::IntSize nextPowerOfTwo(const WebCore::IntSize& size)
 {
-    return IntSize(nextPowerOfTwo(size.width()), nextPowerOfTwo(size.height()));
+    return WebCore::IntSize(nextPowerOfTwo(size.width()), nextPowerOfTwo(size.height()));
 }
 
 class AreaAllocator {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit AreaAllocator(const IntSize&);
+    explicit AreaAllocator(const WebCore::IntSize&);
     virtual ~AreaAllocator();
 
-    IntSize size() const { return m_size; }
+    WebCore::IntSize size() const { return m_size; }
 
-    IntSize minimumAllocation() const { return m_minAlloc; }
-    void setMinimumAllocation(const IntSize& size) { m_minAlloc = size; }
+    WebCore::IntSize minimumAllocation() const { return m_minAlloc; }
+    void setMinimumAllocation(const WebCore::IntSize& size) { m_minAlloc = size; }
 
-    IntSize margin() const { return m_margin; }
-    void setMargin(const IntSize &margin) { m_margin = margin; }
+    WebCore::IntSize margin() const { return m_margin; }
+    void setMargin(const WebCore::IntSize &margin) { m_margin = margin; }
 
-    virtual void expand(const IntSize&);
-    void expandBy(const IntSize&);
+    virtual void expand(const WebCore::IntSize&);
+    void expandBy(const WebCore::IntSize&);
 
-    virtual IntRect allocate(const IntSize&) = 0;
-    virtual void release(const IntRect&);
+    virtual WebCore::IntRect allocate(const WebCore::IntSize&) = 0;
+    virtual void release(const WebCore::IntRect&);
 
     virtual int overhead() const;
 
 protected:
-    IntSize m_size;
-    IntSize m_minAlloc;
-    IntSize m_margin;
+    WebCore::IntSize m_size;
+    WebCore::IntSize m_minAlloc;
+    WebCore::IntSize m_margin;
 
-    IntSize roundAllocation(const IntSize&) const;
+    WebCore::IntSize roundAllocation(const WebCore::IntSize&) const;
 };
 
 class GeneralAreaAllocator : public AreaAllocator {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit GeneralAreaAllocator(const IntSize&);
+    explicit GeneralAreaAllocator(const WebCore::IntSize&);
     virtual ~GeneralAreaAllocator();
 
-    void expand(const IntSize&);
-    IntRect allocate(const IntSize&);
-    void release(const IntRect&);
+    void expand(const WebCore::IntSize&);
+    WebCore::IntRect allocate(const WebCore::IntSize&);
+    void release(const WebCore::IntRect&);
     int overhead() const;
 
 private:
     enum Split { SplitOnX, SplitOnY };
 
     struct Node {
-        IntRect rect;
-        IntSize largestFree;
+        WebCore::IntRect rect;
+        WebCore::IntSize largestFree;
         Node* parent;
         Node* left;
         Node* right;
@@ -102,13 +102,12 @@ private:
     int m_nodeCount;
 
     static void freeNode(Node*);
-    IntPoint allocateFromNode(const IntSize&, Node*);
+    WebCore::IntPoint allocateFromNode(const WebCore::IntSize&, Node*);
     Node* splitNode(Node*, Split);
     static void updateLargestFree(Node*);
 };
 
-} // namespace WebCore
+} // namespace WebKit
 
 #endif // USE(COORDINATED_GRAPHICS)
-
 #endif // AreaAllocator_h
  */
 
 #include "config.h"
+#include "CompositingCoordinator.h"
 
 #if USE(COORDINATED_GRAPHICS)
 
-#include "CompositingCoordinator.h"
-
-#include "DOMWindow.h"
-#include "Document.h"
-#include "FrameView.h"
-#include "GraphicsContext.h"
-#include "InspectorController.h"
-#include "MainFrame.h"
-#include "Page.h"
-#include "Settings.h"
+#include <WebCore/DOMWindow.h>
+#include <WebCore/Document.h>
+#include <WebCore/FrameView.h>
+#include <WebCore/GraphicsContext.h>
+#include <WebCore/InspectorController.h>
+#include <WebCore/MainFrame.h>
+#include <WebCore/Page.h>
+#include <WebCore/Settings.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/TemporaryChange.h>
 
-// FIXME: Having this in the platform directory is a layering violation. This does not belong here.
+using namespace WebCore;
 
-namespace WebCore {
+namespace WebKit {
 
 CompositingCoordinator::CompositingCoordinator(Page* page, CompositingCoordinator::Client* client)
     : m_page(page)
@@ -448,6 +447,6 @@ void CompositingCoordinator::releaseInactiveAtlasesTimerFired()
         m_releaseInactiveAtlasesTimer.stop();
 }
 
-} // namespace WebCore
+} // namespace WebKit
 
 #endif // USE(COORDINATED_GRAPHICS)
 
 #if USE(COORDINATED_GRAPHICS)
 
-#include "CoordinatedGraphicsLayer.h"
-#include "CoordinatedGraphicsState.h"
-#include "CoordinatedImageBacking.h"
-#include "FloatPoint.h"
-#include "GraphicsLayerClient.h"
-#include "GraphicsLayerFactory.h"
-#include "IntRect.h"
-#include "Timer.h"
 #include "UpdateAtlas.h"
+#include <WebCore/CoordinatedGraphicsLayer.h>
+#include <WebCore/CoordinatedGraphicsState.h>
+#include <WebCore/CoordinatedImageBacking.h>
+#include <WebCore/FloatPoint.h>
+#include <WebCore/GraphicsLayerClient.h>
+#include <WebCore/GraphicsLayerFactory.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/Timer.h>
 
 namespace WebCore {
-
 class Page;
 class GraphicsContext;
 class GraphicsLayer;
 class CoordinatedSurface;
+}
 
-class CompositingCoordinator : public GraphicsLayerClient
-    , public CoordinatedGraphicsLayerClient
-    , public CoordinatedImageBacking::Client
+namespace WebKit {
+
+class CompositingCoordinator : public WebCore::GraphicsLayerClient
+    , public WebCore::CoordinatedGraphicsLayerClient
+    , public WebCore::CoordinatedImageBacking::Client
     , public UpdateAtlas::Client
-    , public GraphicsLayerFactory {
+    , public WebCore::GraphicsLayerFactory {
     WTF_MAKE_NONCOPYABLE(CompositingCoordinator); WTF_MAKE_FAST_ALLOCATED;
 public:
     class Client {
     public:
-        virtual void didFlushRootLayer(const FloatRect& visibleContentRect) = 0;
+        virtual void didFlushRootLayer(const WebCore::FloatRect& visibleContentRect) = 0;
         virtual void notifyFlushRequired() = 0;
-        virtual void commitSceneState(const CoordinatedGraphicsState&) = 0;
-        virtual void paintLayerContents(const GraphicsLayer*, GraphicsContext&, const IntRect& clipRect) = 0;
+        virtual void commitSceneState(const WebCore::CoordinatedGraphicsState&) = 0;
+        virtual void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) = 0;
     };
 
-    CompositingCoordinator(Page*, CompositingCoordinator::Client*);
+    CompositingCoordinator(WebCore::Page*, CompositingCoordinator::Client*);
     virtual ~CompositingCoordinator();
 
-    void setRootCompositingLayer(GraphicsLayer*);
-    void setViewOverlayRootLayer(GraphicsLayer*);
-    void sizeDidChange(const IntSize& newSize);
+    void setRootCompositingLayer(WebCore::GraphicsLayer*);
+    void setViewOverlayRootLayer(WebCore::GraphicsLayer*);
+    void sizeDidChange(const WebCore::IntSize&);
     void deviceOrPageScaleFactorChanged();
 
-    void setVisibleContentsRect(const FloatRect&, const FloatPoint&);
+    void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&);
     void renderNextFrame();
     void purgeBackingStores();
-    void commitScrollOffset(uint32_t layerID, const IntSize& offset);
+    void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset);
 
-    void createRootLayer(const IntSize&);
+    void createRootLayer(const WebCore::IntSize&);
     void clearRootLayer() { m_rootLayer = nullptr; }
-    GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
-    CoordinatedGraphicsLayer* mainContentsLayer();
+    WebCore::GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
+    WebCore::CoordinatedGraphicsLayer* mainContentsLayer();
 
     bool flushPendingLayerChanges();
-    CoordinatedGraphicsState& state() { return m_state; }
+    WebCore::CoordinatedGraphicsState& state() { return m_state; }
 
     void syncDisplayState();
 
@@ -90,32 +92,32 @@ public:
 
 private:
     // GraphicsLayerClient
-    void notifyAnimationStarted(const GraphicsLayer*, const String&, double time) override;
-    void notifyFlushRequired(const GraphicsLayer*) override;
-    void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect) override;
+    void notifyAnimationStarted(const WebCore::GraphicsLayer*, const String&, double time) override;
+    void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
+    void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override;
     float deviceScaleFactor() const override;
     float pageScaleFactor() const override;
 
     // CoordinatedImageBacking::Client
-    void createImageBacking(CoordinatedImageBackingID) override;
-    void updateImageBacking(CoordinatedImageBackingID, PassRefPtr<CoordinatedSurface>) override;
-    void clearImageBackingContents(CoordinatedImageBackingID) override;
-    void removeImageBacking(CoordinatedImageBackingID) override;
+    void createImageBacking(WebCore::CoordinatedImageBackingID) override;
+    void updateImageBacking(WebCore::CoordinatedImageBackingID, PassRefPtr<WebCore::CoordinatedSurface>) override;
+    void clearImageBackingContents(WebCore::CoordinatedImageBackingID) override;
+    void removeImageBacking(WebCore::CoordinatedImageBackingID) override;
 
     // CoordinatedGraphicsLayerClient
     bool isFlushingLayerChanges() const override { return m_isFlushingLayerChanges; }
-    FloatRect visibleContentsRect() const override;
-    PassRefPtr<CoordinatedImageBacking> createImageBackingIfNeeded(Image*) override;
-    void detachLayer(CoordinatedGraphicsLayer*) override;
+    WebCore::FloatRect visibleContentsRect() const override;
+    PassRefPtr<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image*) override;
+    void detachLayer(WebCore::CoordinatedGraphicsLayer*) override;
     bool paintToSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& /* atlasID */, WebCore::IntPoint&, WebCore::CoordinatedSurface::Client*) override;
-    void syncLayerState(CoordinatedLayerID, CoordinatedGraphicsLayerState&) override;
+    void syncLayerState(WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayerState&) override;
 
     // UpdateAtlas::Client
-    void createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface>) override;
+    void createUpdateAtlas(uint32_t atlasID, PassRefPtr<WebCore::CoordinatedSurface>) override;
     void removeUpdateAtlas(uint32_t atlasID) override;
 
     // GraphicsLayerFactory
-    std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer::Type, GraphicsLayerClient&) override;
+    std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override;
 
     void initializeRootCompositingLayerIfNeeded();
     void flushPendingImageBackingChanges();
@@ -127,18 +129,18 @@ private:
 
     double timestamp() const;
 
-    Page* m_page;
+    WebCore::Page* m_page;
     CompositingCoordinator::Client* m_client;
 
-    std::unique_ptr<GraphicsLayer> m_rootLayer;
-    GraphicsLayer* m_rootCompositingLayer;
-    GraphicsLayer* m_overlayCompositingLayer;
+    std::unique_ptr<WebCore::GraphicsLayer> m_rootLayer;
+    WebCore::GraphicsLayer* m_rootCompositingLayer;
+    WebCore::GraphicsLayer* m_overlayCompositingLayer;
 
-    CoordinatedGraphicsState m_state;
+    WebCore::CoordinatedGraphicsState m_state;
 
-    typedef HashMap<CoordinatedLayerID, CoordinatedGraphicsLayer*> LayerMap;
+    typedef HashMap<WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayer*> LayerMap;
     LayerMap m_registeredLayers;
-    typedef HashMap<CoordinatedImageBackingID, RefPtr<CoordinatedImageBacking> > ImageBackingMap;
+    typedef HashMap<WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedImageBacking> > ImageBackingMap;
     ImageBackingMap m_imageBackings;
     Vector<std::unique_ptr<UpdateAtlas>> m_updateAtlases;
 
@@ -147,11 +149,11 @@ private:
     bool m_isPurging;
     bool m_isFlushingLayerChanges;
 
-    FloatRect m_visibleContentsRect;
+    WebCore::FloatRect m_visibleContentsRect;
 
     bool m_shouldSyncFrame;
     bool m_didInitializeRootCompositingLayer;
-    Timer m_releaseInactiveAtlasesTimer;
+    WebCore::Timer m_releaseInactiveAtlasesTimer;
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     double m_lastAnimationServiceTime;
@@ -160,6 +162,6 @@ private:
 
 }
 
-#endif
+#endif // namespace WebKit
 
 #endif // CompositingCoordinator_h
index 8a08dfc..f957f70 100644 (file)
@@ -23,8 +23,8 @@
 
 #if USE(COORDINATED_GRAPHICS)
 
+#include "CompositingCoordinator.h"
 #include "LayerTreeHost.h"
-#include <WebCore/CompositingCoordinator.h>
 #include <wtf/RunLoop.h>
 
 namespace WebCore {
@@ -36,7 +36,7 @@ namespace WebKit {
 
 class WebPage;
 
-class CoordinatedLayerTreeHost : public LayerTreeHost, public WebCore::CompositingCoordinator::Client
+class CoordinatedLayerTreeHost : public LayerTreeHost, public CompositingCoordinator::Client
 {
 public:
     static Ref<CoordinatedLayerTreeHost> create(WebPage&);
@@ -85,7 +85,7 @@ private:
 
     static RefPtr<WebCore::CoordinatedSurface> createCoordinatedSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags);
 
-    std::unique_ptr<WebCore::CompositingCoordinator> m_coordinator;
+    std::unique_ptr<CompositingCoordinator> m_coordinator;
     bool m_isWaitingForRenderer { true };
     uint64_t m_forceRepaintAsyncCallbackID { 0 };
     RunLoop::Timer<CoordinatedLayerTreeHost> m_layerFlushTimer;
 
 #if USE(COORDINATED_GRAPHICS)
 
-#include "CoordinatedGraphicsState.h"
-#include "GraphicsContext.h"
-#include "IntRect.h"
+#include <WebCore/CoordinatedGraphicsState.h>
+#include <WebCore/GraphicsContext.h>
+#include <WebCore/IntRect.h>
 #include <wtf/MathExtras.h>
 
-namespace WebCore {
+using namespace WebCore;
+
+namespace WebKit {
 
 class UpdateAtlasSurfaceClient : public CoordinatedSurface::Client {
 public:
@@ -22,8 +22,8 @@
 #define UpdateAtlas_h
 
 #include "AreaAllocator.h"
-#include "CoordinatedSurface.h"
-#include "IntSize.h"
+#include <WebCore/CoordinatedSurface.h>
+#include <WebCore/IntSize.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 class GraphicsContext;
 class IntPoint;
+}
+
+namespace WebKit {
 
 class UpdateAtlas {
     WTF_MAKE_NONCOPYABLE(UpdateAtlas);
 public:
     class Client {
     public:
-        virtual void createUpdateAtlas(uint32_t /* id */, PassRefPtr<CoordinatedSurface>) = 0;
+        virtual void createUpdateAtlas(uint32_t /* id */, PassRefPtr<WebCore::CoordinatedSurface>) = 0;
         virtual void removeUpdateAtlas(uint32_t /* id */) = 0;
     };
 
-    UpdateAtlas(Client*, int dimension, CoordinatedSurface::Flags);
+    UpdateAtlas(Client*, int dimension, WebCore::CoordinatedSurface::Flags);
     ~UpdateAtlas();
 
-    inline IntSize size() const { return m_surface->size(); }
+    inline WebCore::IntSize size() const { return m_surface->size(); }
 
     // Returns false if there is no available buffer.
-    bool paintOnAvailableBuffer(const IntSize&, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client*);
+    bool paintOnAvailableBuffer(const WebCore::IntSize&, uint32_t& atlasID, WebCore::IntPoint& offset, WebCore::CoordinatedSurface::Client*);
     void didSwapBuffers();
     bool supportsAlpha() const { return m_surface->supportsAlpha(); }
 
@@ -70,11 +73,12 @@ private:
 private:
     Client* m_client;
     std::unique_ptr<GeneralAreaAllocator> m_areaAllocator;
-    RefPtr<CoordinatedSurface> m_surface;
+    RefPtr<WebCore::CoordinatedSurface> m_surface;
     double m_inactivityInSeconds;
     uint32_t m_ID;
 };
 
-} // namespace WebCore
+} // namespace WebKit
+
 #endif // USE(COORDINATED_GRAPHICS)
 #endif // UpdateAtlas_h