Coordinated Graphics: Move AreaAllocator and UpdateAtlas to CoordinatedGraphics
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 21:57:23 +0000 (21:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 21:57:23 +0000 (21:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103864

Patch by Jae Hyun Park <jae.park@company100.net> on 2012-12-05
Reviewed by Noam Rosenthal.

AreaAllocator and UpdateAtlas are only used for Coordinated Graphics.
So, these should be moved to CoordinatedGraphics to clarify the code.

No new test, because no change of behavior.

* CMakeLists.txt:
* Target.pri:
* WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp.
(WebKit):
(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/WebKit2/WebProcess/WebPage/AreaAllocator.h.
(WebCore::nextPowerOfTwo):
(WebCore):
(WebKit):
(AreaAllocator):
(WebKit::AreaAllocator::size):
(WebKit::AreaAllocator::minimumAllocation):
(WebKit::AreaAllocator::setMinimumAllocation):
(WebKit::AreaAllocator::margin):
(WebKit::AreaAllocator::setMargin):
(GeneralAreaAllocator):
(Node):
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp.
(WebKit):
(WebKit::UpdateAtlas::UpdateAtlas):
(WebKit::UpdateAtlas::~UpdateAtlas):
(WebKit::UpdateAtlas::buildLayoutIfNeeded):
(WebKit::UpdateAtlas::didSwapBuffers):
(WebKit::UpdateAtlas::beginPaintingOnAvailableBuffer):
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h.
(WebCore):
(WebKit):
(UpdateAtlasClient):
(UpdateAtlas):
(WebKit::UpdateAtlas::size):
(WebKit::UpdateAtlas::flags):
(WebKit::UpdateAtlas::addTimeInactive):
(WebKit::UpdateAtlas::isInactive):
(WebKit::UpdateAtlas::isInUse):

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

Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Target.pri
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp [moved from Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp with 91% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h [moved from Source/WebKit2/WebProcess/WebPage/AreaAllocator.h with 97% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp [moved from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp with 100% similarity]
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h [moved from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h with 100% similarity]

index 003396a657fd45b8be2c8250e092ce2d3f6fd220..5994a2a35cb9c53097aa499b638048d94767fbdd 100644 (file)
@@ -481,11 +481,9 @@ SET(WebKit2_SOURCES
     WebProcess/WebPage/EventDispatcher.cpp
     WebProcess/WebPage/FindController.cpp
 
-    WebProcess/WebPage/AreaAllocator.cpp
     WebProcess/WebPage/LayerTreeHost.cpp
     WebProcess/WebPage/PageOverlay.cpp
     WebProcess/WebPage/TapHighlightController.cpp
-    WebProcess/WebPage/UpdateAtlas.cpp
     WebProcess/WebPage/WebBackForwardListProxy.cpp
     WebProcess/WebPage/WebContextMenu.cpp
     WebProcess/WebPage/WebFrame.cpp
@@ -495,10 +493,12 @@ SET(WebKit2_SOURCES
     WebProcess/WebPage/WebPageGroupProxy.cpp
     WebProcess/WebPage/WebUndoStep.cpp
 
+    WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedImageBacking.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp
     WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp
+    WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp
 )
 
 SET(WebKit2_MESSAGES_IN_FILES
index 62fa21bcb86f86ba0f7c8351aeef2e2babf7827f..2fe235b4f85b237fd230b3a1566629f93c6f2694 100644 (file)
@@ -1,3 +1,67 @@
+2012-12-05  Jae Hyun Park  <jae.park@company100.net>
+
+        Coordinated Graphics: Move AreaAllocator and UpdateAtlas to CoordinatedGraphics
+        https://bugs.webkit.org/show_bug.cgi?id=103864
+
+        Reviewed by Noam Rosenthal.
+
+        AreaAllocator and UpdateAtlas are only used for Coordinated Graphics.
+        So, these should be moved to CoordinatedGraphics to clarify the code.
+
+        No new test, because no change of behavior.
+
+        * CMakeLists.txt:
+        * Target.pri:
+        * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp.
+        (WebKit):
+        (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/WebKit2/WebProcess/WebPage/AreaAllocator.h.
+        (WebCore::nextPowerOfTwo):
+        (WebCore):
+        (WebKit):
+        (AreaAllocator):
+        (WebKit::AreaAllocator::size):
+        (WebKit::AreaAllocator::minimumAllocation):
+        (WebKit::AreaAllocator::setMinimumAllocation):
+        (WebKit::AreaAllocator::margin):
+        (WebKit::AreaAllocator::setMargin):
+        (GeneralAreaAllocator):
+        (Node):
+        * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp.
+        (WebKit):
+        (WebKit::UpdateAtlas::UpdateAtlas):
+        (WebKit::UpdateAtlas::~UpdateAtlas):
+        (WebKit::UpdateAtlas::buildLayoutIfNeeded):
+        (WebKit::UpdateAtlas::didSwapBuffers):
+        (WebKit::UpdateAtlas::beginPaintingOnAvailableBuffer):
+        * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h.
+        (WebCore):
+        (WebKit):
+        (UpdateAtlasClient):
+        (UpdateAtlas):
+        (WebKit::UpdateAtlas::size):
+        (WebKit::UpdateAtlas::flags):
+        (WebKit::UpdateAtlas::addTimeInactive):
+        (WebKit::UpdateAtlas::isInactive):
+        (WebKit::UpdateAtlas::isInUse):
+
 2012-12-05  Michael BrĂ¼ning  <michael.bruning@digia.com>
 
         Fix compilation for Qt5.0.0 stable branch.
index 098b5b9543f5fdfb9b8a931a1282791e6a975691..70229c49e746b4f625de5bc56dddb1de169b1dc9 100644 (file)
@@ -363,18 +363,18 @@ HEADERS += \
     WebProcess/WebCoreSupport/WebSearchPopupMenu.h \
     WebProcess/WebCoreSupport/WebVibrationClient.h \
     WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h \
-    WebProcess/WebPage/AreaAllocator.h \
     WebProcess/WebPage/DrawingArea.h \
     WebProcess/WebPage/DrawingAreaImpl.h \
     WebProcess/WebPage/EventDispatcher.h \
     WebProcess/WebPage/FindController.h \
+    WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedImageBacking.h \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.h \
     WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h \
+    WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h \
     WebProcess/WebPage/TapHighlightController.h \
     WebProcess/WebPage/PageOverlay.h \
-    WebProcess/WebPage/UpdateAtlas.h \
     WebProcess/WebPage/WebContextMenu.h \
     WebProcess/WebPage/WebFrame.h \
     WebProcess/WebPage/WebInspector.h \
@@ -744,21 +744,21 @@ SOURCES += \
     WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp \
     WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
     WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp \
-    WebProcess/WebPage/AreaAllocator.cpp \
     WebProcess/WebPage/DecoderAdapter.cpp \
     WebProcess/WebPage/DrawingArea.cpp \
     WebProcess/WebPage/DrawingAreaImpl.cpp \
     WebProcess/WebPage/EncoderAdapter.cpp \
     WebProcess/WebPage/EventDispatcher.cpp \
     WebProcess/WebPage/FindController.cpp \
+    WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedImageBacking.cpp \
     WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp \
     WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp \
+    WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp \
     WebProcess/WebPage/TapHighlightController.cpp \
     WebProcess/WebPage/LayerTreeHost.cpp \
     WebProcess/WebPage/PageOverlay.cpp \
-    WebProcess/WebPage/UpdateAtlas.cpp \
     WebProcess/WebPage/WebBackForwardListProxy.cpp \
     WebProcess/WebPage/WebContextMenu.cpp \
     WebProcess/WebPage/WebFrame.cpp \
similarity index 91%
rename from Source/WebKit2/WebProcess/WebPage/AreaAllocator.cpp
rename to Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp
index 602efeb5f1aefa7e7af2251741ef67b1411b573c..3befcdac852012cfe93c87a5a9321a81d7535846 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "config.h"
 
+#if USE(COORDINATED_GRAPHICS)
+
 #include "AreaAllocator.h"
 
 namespace WebKit {
@@ -135,14 +137,14 @@ void GeneralAreaAllocator::expand(const WebCore::IntSize& size)
         right->largestFree = m_root->rect.size();
         if (split == SplitOnX) {
             parent->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y(),
-                                            m_root->rect.width() * 2, m_root->rect.height());
+                m_root->rect.width() * 2, m_root->rect.height());
             right->rect = WebCore::IntRect(m_root->rect.x() + m_root->rect.width(), m_root->rect.y(),
-                                           m_root->rect.width(), m_root->rect.height());
+                m_root->rect.width(), m_root->rect.height());
         } else {
             parent->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y(),
-                                            m_root->rect.width(), m_root->rect.height() * 2);
+                m_root->rect.width(), m_root->rect.height() * 2);
             right->rect = WebCore::IntRect(m_root->rect.x(), m_root->rect.y() + m_root->rect.width(),
-                                           m_root->rect.width(), m_root->rect.height());
+                m_root->rect.width(), m_root->rect.height());
         }
         split = (split == SplitOnX ? SplitOnY : SplitOnX);
         m_root = parent;
@@ -254,14 +256,14 @@ GeneralAreaAllocator::Node* GeneralAreaAllocator::splitNode
 
     if (split == SplitOnX) {
         left->rect = WebCore::IntRect(node->rect.x(), node->rect.y(),
-                                      node->rect.width() / 2, node->rect.height());
+            node->rect.width() / 2, node->rect.height());
         right->rect = WebCore::IntRect(left->rect.maxX(), node->rect.y(),
-                                       node->rect.width() / 2, node->rect.height());
+            node->rect.width() / 2, node->rect.height());
     } else {
         left->rect = WebCore::IntRect(node->rect.x(), node->rect.y(),
-                                      node->rect.width(), node->rect.height() / 2);
+            node->rect.width(), node->rect.height() / 2);
         right->rect = WebCore::IntRect(node->rect.x(), left->rect.maxY(),
-                                       node->rect.width(), node->rect.height() / 2);
+            node->rect.width(), node->rect.height() / 2);
     }
 
     left->largestFree = left->rect.size();
@@ -274,9 +276,9 @@ void GeneralAreaAllocator::updateLargestFree(Node* node)
 {
     while ((node = node->parent)) {
         node->largestFree = WebCore::IntSize(
-                                std::max(node->left->largestFree.width(), node->right->largestFree.width()),
-                                std::max(node->left->largestFree.height(), node->right->largestFree.height())
-                            );
+            std::max(node->left->largestFree.width(), node->right->largestFree.width()),
+            std::max(node->left->largestFree.height(), node->right->largestFree.height())
+            );
     }
 }
 
@@ -329,3 +331,5 @@ int GeneralAreaAllocator::overhead() const
 }
 
 } // namespace
+
+#endif // USE(COORDINATED_GRAPHICS)
similarity index 97%
rename from Source/WebKit2/WebProcess/WebPage/AreaAllocator.h
rename to Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h
index ae88716c86d1c1a13adbdb4ea93a4781eed3539e..17f2edac96255f222b5af7858b3512128543ee02 100644 (file)
@@ -24,6 +24,8 @@
 #include <IntRect.h>
 #include <IntSize.h>
 
+#if USE(COORDINATED_GRAPHICS)
+
 namespace WebCore {
 inline int nextPowerOfTwo(int number)
 {
@@ -107,4 +109,6 @@ private:
 
 } // namespace WebKit
 
-#endif
+#endif // USE(COORDINATED_GRAPHICS)
+
+#endif // AreaAllocator_h