[BlackBerry] Add WebPageCompositor class to BlackBerry WebKit API
[WebKit-https.git] / Source / WebKit / blackberry / Api / WebPage_p.h
index eb50b0667c66519b13e3cbd7b256cfba9827f019..6966451a380c89ea065c00e0dbc7e7a6a2a2b4e5 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "ChromeClient.h"
 #if USE(ACCELERATED_COMPOSITING)
+#include "GLES2Context.h"
 #include "LayerRenderer.h"
 #endif
 #include "PageClientBlackBerry.h"
@@ -82,6 +83,8 @@ public:
 
     static WebCore::Page* core(const WebPage*);
 
+    WebPageClient* client() const { return m_client; }
+
     void init(const WebString& pageGroupName);
     bool handleMouseEvent(WebCore::PlatformMouseEvent&);
     bool handleWheelEvent(WebCore::PlatformWheelEvent&);
@@ -368,14 +371,14 @@ public:
     // Thread safe.
     void resetCompositingSurface();
     void drawLayersOnCommit(); // Including backing store blit.
-    bool drawSubLayers(const WebCore::IntRect& dstRect, const WebCore::FloatRect& contents);
-    bool drawSubLayers(); // Draw them at last known position.
 
     // Compositing thread.
     void setRootLayerCompositingThread(WebCore::LayerCompositingThread*);
     void commitRootLayer(const WebCore::IntRect&, const WebCore::IntSize&);
-    void setIsAcceleratedCompositingActive(bool);
-    bool isAcceleratedCompositingActive() const { return m_isAcceleratedCompositingActive; }
+    bool isAcceleratedCompositingActive() const { return m_compositor; }
+    WebPageCompositorPrivate* compositor() const { return m_compositor.get(); }
+    void setCompositor(PassRefPtr<WebPageCompositorPrivate>);
+    bool createCompositor();
     void destroyCompositor();
     void syncDestroyCompositorOnCompositingThread();
     void destroyLayerResources();
@@ -502,7 +505,12 @@ public:
 #if USE(ACCELERATED_COMPOSITING)
     bool m_isAcceleratedCompositingActive;
     OwnPtr<FrameLayers> m_frameLayers; // WebKit thread only.
-    OwnPtr<WebPageCompositorPrivate> m_compositor; // Compositing thread only.
+
+    // Compositing thread only, used only when the WebKit layer created the context.
+    // If the API client created the context, this will be null.
+    OwnPtr<GLES2Context> m_ownedContext;
+
+    RefPtr<WebPageCompositorPrivate> m_compositor; // Compositing thread only.
     OwnPtr<WebCore::Timer<WebPagePrivate> > m_rootLayerCommitTimer;
     bool m_needsOneShotDrawingSynchronization;
     bool m_needsCommit;