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
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
blackberry/WebKitSupport/SurfacePool.cpp
blackberry/WebKitSupport/TouchEventHandler.cpp
blackberry/WebKitSupport/FatFingers.cpp
- blackberry/WebKitSupport/WebPageCompositor.cpp
)
IF (ENABLE_DRT)
class WebPage;
class WebPagePrivate;
-class WebPageCompositor;
+class WebPageCompositorPrivate;
class BackingStorePrivate;
class BackingStoreClient;
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;
#if USE(ACCELERATED_COMPOSITING)
#include "FrameLayers.h"
-#include "WebPageCompositor.h"
+#include "WebPageCompositor_p.h"
#endif
#include <BlackBerryPlatformExecutableMessage.h>
}
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();
#include "config.h"
#if USE(ACCELERATED_COMPOSITING)
-#include "WebPageCompositor.h"
+#include "WebPageCompositor_p.h"
#include "BackingStore_p.h"
#include "LayerWebKitThread.h"
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;
++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
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())
* 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)
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;
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;
};
#endif // USE(ACCELERATED_COMPOSITING)
-#endif // WebPageCompositor_h
+#endif // WebPageCompositor_p_h
#if USE(ACCELERATED_COMPOSITING)
class FrameLayers;
-class WebPageCompositor;
+class WebPageCompositorPrivate;
#endif
// In the client code, there is screen size and viewport.
#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;
+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