[BlackBerry] Rename the existing WebPageCompositor class to WebPageCompositorPrivate
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2012 00:41:19 +0000 (00:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2012 00:41:19 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81108
RIM PR: 136687

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-03-16
Reviewed by Rob Buis.

This is done in anticipation of a new WebPageCompositor class in the
public API. The existing internal class will serve to d-pointerize the
new public API. In addition, it is and will be possible to create only
the private class, for cases where existing code paths require
OpenGL compositing (i.e. due to accelerated compositing layers being
added to the page).

Reviewed internally by Robin Cao.

* Api/BackingStore.h:
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setIsAcceleratedCompositingActive):
* Api/WebPageCompositor.cpp: Renamed from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.cpp.
(BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate):
(BlackBerry::WebKit::WebPageCompositorPrivate::~WebPageCompositorPrivate):
(BlackBerry::WebKit::WebPageCompositorPrivate::hardwareCompositing):
(BlackBerry::WebKit::WebPageCompositorPrivate::setRootLayer):
(BlackBerry::WebKit::WebPageCompositorPrivate::setBackingStoreUsesOpenGL):
(BlackBerry::WebKit::WebPageCompositorPrivate::commit):
(BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
(BlackBerry::WebKit::WebPageCompositorPrivate::releaseLayerResources):
(BlackBerry::WebKit::WebPageCompositorPrivate::animationTimerFired):
* Api/WebPageCompositor_p.h: Renamed from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.h.
(BlackBerry::WebKit::WebPageCompositorPrivate::layoutRectForCompositing):
(BlackBerry::WebKit::WebPageCompositorPrivate::setLayoutRectForCompositing):
(BlackBerry::WebKit::WebPageCompositorPrivate::contentsSizeForCompositing):
(BlackBerry::WebKit::WebPageCompositorPrivate::setContentsSizeForCompositing):
(BlackBerry::WebKit::WebPageCompositorPrivate::lastCompositingResults):
(BlackBerry::WebKit::WebPageCompositorPrivate::setLastCompositingResults):
* Api/WebPage_p.h:
* CMakeListsBlackBerry.txt:

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

Source/WebKit/PlatformBlackBerry.cmake
Source/WebKit/blackberry/Api/BackingStore.h
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/Api/WebPageCompositor.cpp [moved from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.cpp with 83% similarity]
Source/WebKit/blackberry/Api/WebPageCompositor_p.h [moved from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.h with 91% similarity]
Source/WebKit/blackberry/Api/WebPage_p.h
Source/WebKit/blackberry/ChangeLog

index b0d07546a79776f01de544a89bb88eb61c4281c8..000e28c4870be20b4a532e79afa57c9fd948a323 100644 (file)
@@ -44,6 +44,7 @@ LIST(APPEND WebKit_SOURCES
     blackberry/Api/WebKitMIMETypeConverter.cpp
     blackberry/Api/WebKitTextCodec.cpp
     blackberry/Api/WebPage.cpp
+    blackberry/Api/WebPageCompositor.cpp
     blackberry/Api/WebPageGroupLoadDeferrer.cpp
     blackberry/Api/WebSettings.cpp
     blackberry/WebCoreSupport/AboutData.cpp
@@ -77,7 +78,6 @@ LIST(APPEND WebKit_SOURCES
     blackberry/WebKitSupport/SurfacePool.cpp
     blackberry/WebKitSupport/TouchEventHandler.cpp
     blackberry/WebKitSupport/FatFingers.cpp
-    blackberry/WebKitSupport/WebPageCompositor.cpp
 )
 
 IF (ENABLE_DRT)
index 9f0ddf78d4e63ad74afbfa2f893042f2e8753935..a31f517929b0b9c5c1bd5cc2a72ddfeb81bfe58c 100644 (file)
@@ -40,7 +40,7 @@ namespace WebKit {
 
 class WebPage;
 class WebPagePrivate;
-class WebPageCompositor;
+class WebPageCompositorPrivate;
 class BackingStorePrivate;
 class BackingStoreClient;
 
@@ -81,7 +81,7 @@ private:
     friend class BlackBerry::WebKit::BackingStoreClient;
     friend class BlackBerry::WebKit::WebPage;
     friend class BlackBerry::WebKit::WebPagePrivate; // FIXME: For now, we expose our internals to WebPagePrivate. See PR #120301.
-    friend class BlackBerry::WebKit::WebPageCompositor;
+    friend class BlackBerry::WebKit::WebPageCompositorPrivate;
     friend class WebCore::ChromeClientBlackBerry;
     friend class WebCore::FrameLoaderClientBlackBerry;
     friend class WebCore::GLES2Context;
index a5bc3e46acd2e0877764a1635bc63d3044717315..b5da38b8d1938c2dab3da8593fe9dced15511ec5 100644 (file)
 
 #if USE(ACCELERATED_COMPOSITING)
 #include "FrameLayers.h"
-#include "WebPageCompositor.h"
+#include "WebPageCompositor_p.h"
 #endif
 
 #include <BlackBerryPlatformExecutableMessage.h>
@@ -5325,7 +5325,7 @@ void WebPagePrivate::setIsAcceleratedCompositingActive(bool active)
     }
 
     if (!m_compositor) {
-        m_compositor = adoptPtr(new WebPageCompositor(this));
+        m_compositor = adoptPtr(new WebPageCompositorPrivate(this));
         m_isAcceleratedCompositingActive = m_compositor->hardwareCompositing();
         if (!m_isAcceleratedCompositingActive)
             m_compositor.clear();
similarity index 83%
rename from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.cpp
rename to Source/WebKit/blackberry/Api/WebPageCompositor.cpp
index 3825fd0fb9862620e8fa51b734436ec1258d9d99..f6bae0b0cc4ec2518799abe34579a6e7e7b76cd5 100644 (file)
@@ -19,7 +19,7 @@
 #include "config.h"
 
 #if USE(ACCELERATED_COMPOSITING)
-#include "WebPageCompositor.h"
+#include "WebPageCompositor_p.h"
 
 #include "BackingStore_p.h"
 #include "LayerWebKitThread.h"
@@ -36,43 +36,43 @@ using namespace WebCore;
 namespace BlackBerry {
 namespace WebKit {
 
-WebPageCompositor::WebPageCompositor(WebPagePrivate* page)
+WebPageCompositorPrivate::WebPageCompositorPrivate(WebPagePrivate* page)
     : m_webPage(page)
     , m_context(GLES2Context::create(page))
     , m_layerRenderer(LayerRenderer::create(m_context.get()))
     , m_generation(0)
     , m_compositedGeneration(-1)
     , m_backingStoreUsesOpenGL(false)
-    , m_animationTimer(this, &WebPageCompositor::animationTimerFired)
+    , m_animationTimer(this, &WebPageCompositorPrivate::animationTimerFired)
     , m_timerClient(new Platform::GenericTimerClient(Platform::userInterfaceThreadTimerClient()))
 {
     m_animationTimer.setClient(m_timerClient);
 }
 
-WebPageCompositor::~WebPageCompositor()
+WebPageCompositorPrivate::~WebPageCompositorPrivate()
 {
     m_animationTimer.stop();
     delete m_timerClient;
 }
 
-bool WebPageCompositor::hardwareCompositing() const
+bool WebPageCompositorPrivate::hardwareCompositing() const
 {
     return m_layerRenderer->hardwareCompositing();
 }
 
-void WebPageCompositor::setRootLayer(LayerCompositingThread* rootLayer)
+void WebPageCompositorPrivate::setRootLayer(LayerCompositingThread* rootLayer)
 {
     m_rootLayer = rootLayer;
     m_layerRenderer->setRootLayer(m_rootLayer.get());
 }
 
-void WebPageCompositor::setBackingStoreUsesOpenGL(bool backingStoreUsesOpenGL)
+void WebPageCompositorPrivate::setBackingStoreUsesOpenGL(bool backingStoreUsesOpenGL)
 {
     m_backingStoreUsesOpenGL = backingStoreUsesOpenGL;
     m_layerRenderer->setClearSurfaceOnDrawLayers(!backingStoreUsesOpenGL);
 }
 
-void WebPageCompositor::commit(LayerWebKitThread* rootLayer)
+void WebPageCompositorPrivate::commit(LayerWebKitThread* rootLayer)
 {
     if (!rootLayer)
         return;
@@ -81,7 +81,7 @@ void WebPageCompositor::commit(LayerWebKitThread* rootLayer)
     ++m_generation;
 }
 
-bool WebPageCompositor::drawLayers(const IntRect& dstRect, const FloatRect& contents)
+bool WebPageCompositorPrivate::drawLayers(const IntRect& dstRect, const FloatRect& contents)
 {
     // Save a draw if we already drew this generation, for example due to a concurrent scroll operation.
     if (m_compositedGeneration == m_generation && dstRect == m_compositedDstRect
@@ -105,12 +105,12 @@ bool WebPageCompositor::drawLayers(const IntRect& dstRect, const FloatRect& cont
     return true;
 }
 
-void WebPageCompositor::releaseLayerResources()
+void WebPageCompositorPrivate::releaseLayerResources()
 {
     m_layerRenderer->releaseLayerResources();
 }
 
-void WebPageCompositor::animationTimerFired()
+void WebPageCompositorPrivate::animationTimerFired()
 {
     if (m_webPage->m_backingStore->d->shouldDirectRenderingToWindow()) {
         if (m_webPage->m_backingStore->d->isDirectRenderingAnimationMessageScheduled())
similarity index 91%
rename from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.h
rename to Source/WebKit/blackberry/Api/WebPageCompositor_p.h
index 70460e32c66647307814d0784235337d36c7c5ed..dafc2db4033d89f511544a16ff557b29b22ca52f 100644 (file)
@@ -16,8 +16,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef WebPageCompositor_h
-#define WebPageCompositor_h
+#ifndef WebPageCompositor_p_h
+#define WebPageCompositor_p_h
 
 #if USE(ACCELERATED_COMPOSITING)
 
@@ -39,10 +39,10 @@ namespace WebKit {
 class WebPagePrivate;
 
 // This class may only be used on the compositing thread.
-class WebPageCompositor {
+class WebPageCompositorPrivate {
 public:
-    WebPageCompositor(WebPagePrivate*);
-    ~WebPageCompositor();
+    WebPageCompositorPrivate(WebPagePrivate*);
+    ~WebPageCompositorPrivate();
 
     bool hardwareCompositing() const;
 
@@ -81,7 +81,7 @@ private:
     WebCore::IntRect m_compositedDstRect;
     WebCore::FloatRect m_compositedContentsRect;
     bool m_backingStoreUsesOpenGL;
-    BlackBerry::Platform::Timer<WebPageCompositor> m_animationTimer;
+    BlackBerry::Platform::Timer<WebPageCompositorPrivate> m_animationTimer;
     BlackBerry::Platform::TimerClient* m_timerClient;
 };
 
@@ -90,4 +90,4 @@ private:
 
 #endif // USE(ACCELERATED_COMPOSITING)
 
-#endif // WebPageCompositor_h
+#endif // WebPageCompositor_p_h
index 4047a6138b04183283007fb19af972e6da2c4091..006a38414906e39863d903c8f1a1368ee2367cde 100644 (file)
@@ -65,7 +65,7 @@ class WebPageClient;
 
 #if USE(ACCELERATED_COMPOSITING)
 class FrameLayers;
-class WebPageCompositor;
+class WebPageCompositorPrivate;
 #endif
 
 // In the client code, there is screen size and viewport.
@@ -499,7 +499,7 @@ public:
 #if USE(ACCELERATED_COMPOSITING)
     bool m_isAcceleratedCompositingActive;
     OwnPtr<FrameLayers> m_frameLayers; // WebKit thread only.
-    OwnPtr<WebPageCompositor> m_compositor; // Compositing thread only.
+    OwnPtr<WebPageCompositorPrivate> m_compositor; // Compositing thread only.
     OwnPtr<WebCore::Timer<WebPagePrivate> > m_rootLayerCommitTimer;
     bool m_needsOneShotDrawingSynchronization;
     bool m_needsCommit;
index 40d121edc033032a200218083d7256a5505a1d2b..f8e8d4f843bab515cf9e7a422df1f6f099f06fea 100644 (file)
@@ -1,3 +1,43 @@
+2012-03-16  Arvid Nilsson  <anilsson@rim.com>
+
+        [BlackBerry] Rename the existing WebPageCompositor class to WebPageCompositorPrivate
+        https://bugs.webkit.org/show_bug.cgi?id=81108
+        RIM PR: 136687
+
+        Reviewed by Rob Buis.
+
+        This is done in anticipation of a new WebPageCompositor class in the
+        public API. The existing internal class will serve to d-pointerize the
+        new public API. In addition, it is and will be possible to create only
+        the private class, for cases where existing code paths require
+        OpenGL compositing (i.e. due to accelerated compositing layers being
+        added to the page).
+
+        Reviewed internally by Robin Cao.
+
+        * Api/BackingStore.h:
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::setIsAcceleratedCompositingActive):
+        * Api/WebPageCompositor.cpp: Renamed from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.cpp.
+        (BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::~WebPageCompositorPrivate):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::hardwareCompositing):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setRootLayer):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setBackingStoreUsesOpenGL):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::commit):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::releaseLayerResources):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::animationTimerFired):
+        * Api/WebPageCompositor_p.h: Renamed from Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.h.
+        (BlackBerry::WebKit::WebPageCompositorPrivate::layoutRectForCompositing):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setLayoutRectForCompositing):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::contentsSizeForCompositing):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setContentsSizeForCompositing):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::lastCompositingResults):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setLastCompositingResults):
+        * Api/WebPage_p.h:
+        * CMakeListsBlackBerry.txt:
+
 2012-03-16  Nima Ghanavatian  <nghanavatian@rim.com>
 
         [BlackBerry] Syncing up left over bits in WebKitSupport from our local branch to upstream