Changeset 111959 in webkit
- Timestamp:
- Mar 23, 2012 6:12:23 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/BackingStore.cpp
r111398 r111959 33 33 #include "WebPage.h" 34 34 #include "WebPageClient.h" 35 #include "WebPageCompositorClient.h" 36 #include "WebPageCompositor_p.h" 35 37 #include "WebPage_p.h" 36 38 #include "WebSettings.h" … … 1241 1243 1242 1244 if (m_defersBlit && !force) { 1245 #if USE(ACCELERATED_COMPOSITING) 1246 // If there's a WebPageCompositorClient, let it schedule the blit. 1247 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor()) { 1248 if (WebPageCompositorClient* client = compositor->client()) { 1249 client->invalidate(compositor->animationFrameTimestamp()); 1250 return; 1251 } 1252 } 1253 #endif 1254 1243 1255 m_hasBlitJobs = true; 1244 1256 return; … … 1446 1458 WebCore::FloatRect contentsRect = m_webPage->d->mapFromTransformedFloatRect( 1447 1459 WebCore::FloatRect(WebCore::IntRect(contents))); 1448 m_webPage->d->drawSubLayers(dstRect, contentsRect); 1460 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor()) 1461 compositor->drawLayers(dstRect, contentsRect); 1449 1462 } else if (compositingSurface) 1450 1463 blendCompositingSurface(dstRect); … … 2520 2533 return false; 2521 2534 2535 if (!m_webPage->d->compositor()) 2536 return false; 2537 2522 2538 Platform::IntRect dst = m_webPage->client()->userInterfaceBlittedDestinationRect(); 2523 2539 if (dst.isEmpty()) … … 2527 2543 WebCore::FloatRect contentsRect = m_webPage->d->mapFromTransformedFloatRect( 2528 2544 WebCore::FloatRect(WebCore::IntRect(src))); 2529 return m_webPage->d-> drawSubLayers(dst, contentsRect);2545 return m_webPage->d->compositor()->drawLayers(dst, contentsRect); 2530 2546 } 2531 2547 … … 2558 2574 // Check if rendering caused a commit and we need to redraw the layers. 2559 2575 m_needsDrawLayersOnCommit = false; 2560 m_webPage->d->drawSubLayers(dstRect, untransformedContentsRect); 2576 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor()) 2577 compositor->drawLayers(dstRect, untransformedContentsRect); 2561 2578 2562 2579 #if ENABLE_COMPOSITING_SURFACE … … 2681 2698 bool BackingStore::hasBlitJobs() const 2682 2699 { 2700 #if USE(ACCELERATED_COMPOSITING) 2701 // If there's a WebPageCompositorClient, let it schedule the blit. 2702 WebPageCompositorPrivate* compositor = d->m_webPage->d->compositor(); 2703 if (compositor && compositor->client()) 2704 return false; 2705 #endif 2706 2683 2707 // Normally, this would be called from the compositing thread, 2684 2708 // and the flag is set on the compositing thread, so no need for … … 2689 2713 void BackingStore::blitOnIdle() 2690 2714 { 2715 #if USE(ACCELERATED_COMPOSITING) 2716 // If there's a WebPageCompositorClient, let it schedule the blit. 2717 WebPageCompositorPrivate* compositor = d->m_webPage->d->compositor(); 2718 if (compositor && compositor->client()) 2719 return; 2720 #endif 2721 2691 2722 d->blitVisibleContents(true /*force*/); 2692 2723 } … … 2697 2728 return window->surfaceSize(); 2698 2729 2730 #if USE(ACCELERATED_COMPOSITING) 2731 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor()) 2732 return compositor->context()->surfaceSize(); 2733 #endif 2734 2699 2735 return Platform::IntSize(); 2700 2736 } … … 2705 2741 return window->buffer(); 2706 2742 2743 #if USE(ACCELERATED_COMPOSITING) 2744 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor()) 2745 return compositor->context()->buffer(); 2746 #endif 2747 2707 2748 return 0; 2708 2749 } -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r111811 r111959 329 329 , m_inRegionScrollStartingNode(0) 330 330 #if USE(ACCELERATED_COMPOSITING) 331 , m_isAcceleratedCompositingActive(false)332 331 , m_rootLayerCommitTimer(adoptPtr(new Timer<WebPagePrivate>(this, &WebPagePrivate::rootLayerCommitTimerFired))) 333 332 , m_needsOneShotDrawingSynchronization(false) … … 5195 5194 } 5196 5195 5197 if (! drawSubLayers())5196 if (!m_backingStore->d->drawSubLayers()) 5198 5197 return; 5199 5198 … … 5212 5211 5213 5212 m_backingStore->d->blitVisibleContents(); 5214 }5215 5216 bool WebPagePrivate::drawSubLayers(const IntRect& dstRect, const FloatRect& contents)5217 {5218 ASSERT(Platform::userInterfaceThreadMessageClient()->isCurrentThread());5219 if (!Platform::userInterfaceThreadMessageClient()->isCurrentThread())5220 return false;5221 5222 if (m_compositor) {5223 m_compositor->setBackingStoreUsesOpenGL(m_backingStore->d->isOpenGLCompositing());5224 return m_compositor->drawLayers(dstRect, contents);5225 }5226 5227 return false;5228 }5229 5230 bool WebPagePrivate::drawSubLayers()5231 {5232 ASSERT(Platform::userInterfaceThreadMessageClient()->isCurrentThread());5233 if (!Platform::userInterfaceThreadMessageClient()->isCurrentThread())5234 return false;5235 5236 return m_backingStore->d->drawSubLayers();5237 5213 } 5238 5214 … … 5271 5247 } 5272 5248 5249 void WebPagePrivate::setCompositor(PassRefPtr<WebPageCompositorPrivate> compositor) 5250 { 5251 using namespace BlackBerry::Platform; 5252 5253 // The m_compositor member has to be modified during a sync call for thread 5254 // safe access to m_compositor and its refcount. 5255 if (!userInterfaceThreadMessageClient()->isCurrentThread()) { 5256 userInterfaceThreadMessageClient()->dispatchSyncMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, this, compositor)); 5257 return; 5258 } 5259 5260 m_compositor = compositor; 5261 5262 // The previous compositor, if any, has now released it's OpenGL resources, 5263 // so we can safely free the owned context, if any. 5264 m_ownedContext.clear(); 5265 } 5266 5273 5267 void WebPagePrivate::commitRootLayer(const IntRect& layoutRectForCompositing, 5274 5268 const IntSize& contentsSizeForCompositing) … … 5368 5362 if (commitRootLayerIfNeeded()) 5369 5363 drawLayersOnCommit(); 5370 }5371 5372 void WebPagePrivate::setIsAcceleratedCompositingActive(bool active)5373 {5374 // Backing store can be null here because it happens during teardown.5375 if (m_isAcceleratedCompositingActive == active || !m_backingStore)5376 return;5377 5378 m_isAcceleratedCompositingActive = active;5379 5380 if (!active) {5381 m_compositor.clear();5382 resetCompositingSurface();5383 return;5384 }5385 5386 if (!m_compositor) {5387 m_compositor = adoptPtr(new WebPageCompositorPrivate(this));5388 m_isAcceleratedCompositingActive = m_compositor->hardwareCompositing();5389 if (!m_isAcceleratedCompositingActive)5390 m_compositor.clear();5391 }5392 5364 } 5393 5365 … … 5450 5422 // called syncDestroyCompositorOnCompositingThread() to destroy 5451 5423 // the compositor. 5452 setIsAcceleratedCompositingActive(false); 5424 destroyCompositor(); 5425 resetCompositingSurface(); 5453 5426 return; 5454 5427 } 5455 5428 5456 5429 if (!m_compositor) 5457 setIsAcceleratedCompositingActive(true);5430 createCompositor(); 5458 5431 5459 5432 // Don't ASSERT(m_compositor) here because setIsAcceleratedCompositingActive(true) … … 5463 5436 } 5464 5437 5438 bool WebPagePrivate::createCompositor() 5439 { 5440 m_ownedContext = GLES2Context::create(this); 5441 m_compositor = WebPageCompositorPrivate::create(this, 0); 5442 m_compositor->setContext(m_ownedContext.get()); 5443 5444 if (!m_compositor->hardwareCompositing()) { 5445 destroyCompositor(); 5446 return false; 5447 } 5448 5449 return true; 5450 } 5451 5465 5452 void WebPagePrivate::destroyCompositor() 5466 5453 { 5467 m_compositor.clear(); 5454 // We shouldn't release the compositor unless we created and own the 5455 // context. If the compositor was created from the WebPageCompositor API, 5456 // keep it around and reuse it later. 5457 if (!m_ownedContext) 5458 return; 5459 5460 m_compositor.clear(); 5461 m_ownedContext.clear(); 5468 5462 } 5469 5463 -
trunk/Source/WebKit/blackberry/Api/WebPage.h
r111811 r111959 63 63 class RenderQueue; 64 64 class WebPageClient; 65 class WebPageCompositor; 65 66 class WebPageGroupLoadDeferrer; 66 67 class WebPagePrivate; … … 336 337 friend class WebKit::BackingStorePrivate; 337 338 friend class WebKit::RenderQueue; 339 friend class WebKit::WebPageCompositor; 338 340 friend class WebKit::WebPageGroupLoadDeferrer; 339 341 friend class WebKit::WebPagePrivate; -
trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
r111180 r111959 19 19 #include "config.h" 20 20 21 #include "WebPageCompositor.h" 22 21 23 #if USE(ACCELERATED_COMPOSITING) 24 #include "WebPageCompositorClient.h" 22 25 #include "WebPageCompositor_p.h" 23 26 … … 26 29 #include "WebPage_p.h" 27 30 31 #include <BlackBerryPlatformDebugMacros.h> 28 32 #include <BlackBerryPlatformExecutableMessage.h> 29 33 #include <BlackBerryPlatformMessage.h> … … 37 41 namespace WebKit { 38 42 39 WebPageCompositorPrivate::WebPageCompositorPrivate(WebPagePrivate* page) 40 : m_webPage(page) 41 , m_context(GLES2Context::create(page)) 42 , m_layerRenderer(LayerRenderer::create(m_context.get())) 43 , m_backingStoreUsesOpenGL(false) 43 WebPageCompositorPrivate::WebPageCompositorPrivate(WebPagePrivate* page, WebPageCompositorClient* client) 44 : m_client(client) 45 , m_webPage(page) 44 46 , m_animationTimer(this, &WebPageCompositorPrivate::animationTimerFired) 45 47 , m_timerClient(new Platform::GenericTimerClient(Platform::userInterfaceThreadTimerClient())) 48 , m_pendingAnimationFrame(0.0) 46 49 { 47 50 m_animationTimer.setClient(m_timerClient); … … 54 57 } 55 58 59 void WebPageCompositorPrivate::setContext(Platform::Graphics::GLES2Context* context) 60 { 61 if (m_context == context) 62 return; 63 64 m_context = context; 65 if (!m_context) { 66 m_layerRenderer.clear(); 67 return; 68 } 69 70 m_layerRenderer = LayerRenderer::create(m_context); 71 } 72 56 73 bool WebPageCompositorPrivate::hardwareCompositing() const 57 74 { 58 return m_layerRenderer ->hardwareCompositing();75 return m_layerRenderer && m_layerRenderer->hardwareCompositing(); 59 76 } 60 77 … … 62 79 { 63 80 m_rootLayer = rootLayer; 64 m_layerRenderer->setRootLayer(m_rootLayer.get()); 65 } 66 67 void WebPageCompositorPrivate::setBackingStoreUsesOpenGL(bool backingStoreUsesOpenGL) 68 { 69 m_backingStoreUsesOpenGL = backingStoreUsesOpenGL; 70 m_layerRenderer->setClearSurfaceOnDrawLayers(!backingStoreUsesOpenGL); 81 82 ASSERT(m_layerRenderer); 83 if (m_layerRenderer) 84 m_layerRenderer->setRootLayer(m_rootLayer.get()); 71 85 } 72 86 … … 79 93 } 80 94 95 void WebPageCompositorPrivate::render(const IntRect& dstRect, const IntRect& transformedContents) 96 { 97 // It's not safe to call into the BackingStore if the compositor hasn't been set yet. 98 // For thread safety, we have to do it using a round-trip to the WebKit thread, so the 99 // embedder might call this before the round-trip to WebPagePrivate::setCompositor() is 100 // done. 101 if (m_webPage->compositor() != this) 102 return; 103 104 // The BackingStore is the root layer 105 if (BackingStore* backingStore = m_webPage->m_backingStore) 106 backingStore->d->blitContents(dstRect, transformedContents, true); 107 else { 108 FloatRect contents = m_webPage->mapFromTransformedFloatRect(FloatRect(transformedContents)); 109 drawLayers(dstRect, contents); 110 } 111 } 112 81 113 bool WebPageCompositorPrivate::drawLayers(const IntRect& dstRect, const FloatRect& contents) 82 114 { 115 if (!m_layerRenderer) 116 return false; 117 118 m_pendingAnimationFrame = 0.0; 119 120 bool shouldClear = false; 121 if (BackingStore* backingStore = m_webPage->m_backingStore) 122 shouldClear = !backingStore->d->isOpenGLCompositing(); 123 m_layerRenderer->setClearSurfaceOnDrawLayers(shouldClear); 124 83 125 m_layerRenderer->drawLayers(contents, m_layoutRectForCompositing, m_contentsSizeForCompositing, dstRect); 84 126 m_lastCompositingResults = m_layerRenderer->lastRenderingResults(); … … 86 128 if (m_lastCompositingResults.needsAnimationFrame) { 87 129 // Using a timeout of 0 actually won't start a timer, it will send a message. 88 m_animationTimer.start(1.0 / 60.0); 89 m_webPage->updateDelegatedOverlays(); 130 if (m_client) 131 m_pendingAnimationFrame = m_client->requestAnimationFrame(); 132 else { 133 m_animationTimer.start(1.0 / 60.0); 134 m_webPage->updateDelegatedOverlays(); 135 } 90 136 } 91 137 … … 100 146 void WebPageCompositorPrivate::animationTimerFired() 101 147 { 102 if (m_webPage->m_backingStore->d->shouldDirectRenderingToWindow()) { 103 if (m_webPage->m_backingStore->d->isDirectRenderingAnimationMessageScheduled()) 148 BackingStore* backingStore = m_webPage->m_backingStore; 149 if (!backingStore) { 150 drawLayers(m_webPage->client()->userInterfaceBlittedDestinationRect(), 151 IntRect(m_webPage->client()->userInterfaceBlittedVisibleContentsRect())); 152 return; 153 } 154 155 if (backingStore->d->shouldDirectRenderingToWindow()) { 156 if (backingStore->d->isDirectRenderingAnimationMessageScheduled()) 104 157 return; // don't send new messages as long as we haven't rerendered 105 158 106 m_webPage->m_backingStore->d->setDirectRenderingAnimationMessageScheduled();107 BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage( 108 BlackBerry::Platform::createMethodCallMessage(109 &BackingStorePrivate::renderVisibleContents, m_webPage->m_backingStore->d));159 using namespace BlackBerry::Platform; 160 161 backingStore->d->setDirectRenderingAnimationMessageScheduled(); 162 webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&BackingStorePrivate::renderVisibleContents, backingStore->d)); 110 163 return; 111 164 } 112 165 m_webPage->blitVisibleContents(); 166 } 167 168 void WebPageCompositorPrivate::compositorDestroyed() 169 { 170 if (m_client) 171 m_client->compositorDestroyed(); 172 173 m_client = 0; 174 } 175 176 WebPageCompositor::WebPageCompositor(WebPage* page, WebPageCompositorClient* client) 177 { 178 using namespace BlackBerry::Platform; 179 180 RefPtr<WebPageCompositorPrivate> tmp = WebPageCompositorPrivate::create(page->d, client); 181 182 // Keep one ref ourselves... 183 d = tmp.get(); 184 d->ref(); 185 186 // ...And pass one ref to the web page. 187 // This ensures that the compositor will be around for as long as it's 188 // needed. Unfortunately RefPtr<T> is not public, so we have declare to 189 // resort to manual refcounting. 190 webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), tmp)); 191 } 192 193 WebPageCompositor::~WebPageCompositor() 194 { 195 using namespace BlackBerry::Platform; 196 197 webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&WebPagePrivate::setCompositor, d->page(), PassRefPtr<WebPageCompositorPrivate>(0))); 198 d->compositorDestroyed(); 199 d->deref(); 200 } 201 202 WebPageCompositorClient* WebPageCompositor::client() const 203 { 204 return 0; 205 } 206 207 void WebPageCompositor::prepareFrame(Platform::Graphics::GLES2Context* context, double timestamp) 208 { 209 d->setContext(context); 210 } 211 212 void WebPageCompositor::render(Platform::Graphics::GLES2Context* context, const Platform::IntRect& dstRect, const Platform::IntRect& contents) 213 { 214 d->setContext(context); 215 d->render(dstRect, contents); 216 } 217 218 void WebPageCompositor::cleanup(Platform::Graphics::GLES2Context* context) 219 { 220 d->setContext(0); 221 } 222 223 void WebPageCompositor::contextLost() 224 { 225 // This method needs to delete the compositor in a way that not tries to 226 // use any OpenGL calls (the context is gone, so we can't and don't need to 227 // free any OpenGL resources. 228 notImplemented(); 113 229 } 114 230 … … 116 232 } // namespace BlackBerry 117 233 234 #else // USE(ACCELERATED_COMPOSITING) 235 236 namespace BlackBerry { 237 namespace WebKit { 238 239 WebPageCompositor::WebPageCompositor(WebPage*, WebPageCompositorClient*) 240 : d(0) 241 { 242 } 243 244 WebPageCompositor::~WebPageCompositor() 245 { 246 } 247 248 WebPageCompositorClient* WebPageCompositor::client() const 249 { 250 return 0; 251 } 252 253 void WebPageCompositor::prepareFrame(Platform::Graphics::GLES2Context*, double) 254 { 255 } 256 257 void WebPageCompositor::render(Platform::Graphics::GLES2Context*, const Platform::IntRect&, const Platform::IntRect&) 258 { 259 } 260 261 void WebPageCompositor::cleanup(Platform::Graphics::GLES2Context*) 262 { 263 } 264 265 void WebPageCompositor::contextLost() 266 { 267 } 268 269 } // namespace WebKit 270 } // namespace BlackBerry 271 118 272 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h
r111180 r111959 22 22 #if USE(ACCELERATED_COMPOSITING) 23 23 24 #include "GLES2Context.h"25 24 #include "LayerCompositingThread.h" 26 25 #include "LayerRenderer.h" 27 26 27 #include <BlackBerryPlatformGLES2Context.h> 28 28 #include <BlackBerryPlatformTimer.h> 29 29 #include <wtf/OwnPtr.h> 30 #include <wtf/RefCounted.h> 30 31 #include <wtf/RefPtr.h> 31 32 … … 37 38 namespace WebKit { 38 39 40 class WebPageCompositorClient; 39 41 class WebPagePrivate; 40 42 41 // This class may only be used on the compositing thread. 42 class WebPageCompositorPrivate {43 // This class may only be used on the compositing thread. So it does not need to be threadsaferefcounted. 44 class WebPageCompositorPrivate : public RefCounted<WebPageCompositorPrivate> { 43 45 public: 44 WebPageCompositorPrivate(WebPagePrivate*); 46 static PassRefPtr<WebPageCompositorPrivate> create(WebPagePrivate* page, WebPageCompositorClient* client) 47 { 48 return adoptRef(new WebPageCompositorPrivate(page, client)); 49 } 50 45 51 ~WebPageCompositorPrivate(); 46 52 47 53 bool hardwareCompositing() const; 48 54 55 Platform::Graphics::GLES2Context* context() const { return m_context; } 56 void setContext(Platform::Graphics::GLES2Context*); 57 49 58 void setRootLayer(WebCore::LayerCompositingThread*); 50 51 void setBackingStoreUsesOpenGL(bool);52 59 53 60 void commit(WebCore::LayerWebKitThread* rootLayerProxy); 54 61 62 // This is mapped from the public API, thus takes transformed contents 63 void render(const WebCore::IntRect& dstRect, const WebCore::IntRect& transformedContents); 64 65 // Render everything but the root layer 55 66 bool drawLayers(const WebCore::IntRect& dstRect, const WebCore::FloatRect& contents); 56 67 … … 64 75 void setLastCompositingResults(const WebCore::LayerRenderingResults& results) { m_lastCompositingResults = results; } 65 76 77 double animationFrameTimestamp() const { return m_pendingAnimationFrame; } 78 66 79 void releaseLayerResources(); 80 81 WebPagePrivate* page() const { return m_webPage; } 82 WebPageCompositorClient* client() const { return m_client; } 83 void compositorDestroyed(); 84 85 protected: 86 WebPageCompositorPrivate(WebPagePrivate*, WebPageCompositorClient*); 67 87 68 88 private: 69 89 void animationTimerFired(); 70 90 91 WebPageCompositorClient* m_client; 71 92 WebPagePrivate* m_webPage; 72 // Please maintain this order since m_layerRenderer depends on m_context in initialization list. 73 OwnPtr<GLES2Context> m_context; 93 Platform::Graphics::GLES2Context* m_context; 74 94 OwnPtr<WebCore::LayerRenderer> m_layerRenderer; 75 95 RefPtr<WebCore::LayerCompositingThread> m_rootLayer; … … 77 97 WebCore::IntSize m_contentsSizeForCompositing; 78 98 WebCore::LayerRenderingResults m_lastCompositingResults; 79 bool m_backingStoreUsesOpenGL;80 99 BlackBerry::Platform::Timer<WebPageCompositorPrivate> m_animationTimer; 81 100 BlackBerry::Platform::TimerClient* m_timerClient; 101 double m_pendingAnimationFrame; 82 102 }; 83 103 -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r111810 r111959 22 22 #include "ChromeClient.h" 23 23 #if USE(ACCELERATED_COMPOSITING) 24 #include "GLES2Context.h" 24 25 #include "LayerRenderer.h" 25 26 #endif … … 82 83 83 84 static WebCore::Page* core(const WebPage*); 85 86 WebPageClient* client() const { return m_client; } 84 87 85 88 void init(const WebString& pageGroupName); … … 369 372 void resetCompositingSurface(); 370 373 void drawLayersOnCommit(); // Including backing store blit. 371 bool drawSubLayers(const WebCore::IntRect& dstRect, const WebCore::FloatRect& contents);372 bool drawSubLayers(); // Draw them at last known position.373 374 374 375 // Compositing thread. 375 376 void setRootLayerCompositingThread(WebCore::LayerCompositingThread*); 376 377 void commitRootLayer(const WebCore::IntRect&, const WebCore::IntSize&); 377 void setIsAcceleratedCompositingActive(bool); 378 bool isAcceleratedCompositingActive() const { return m_isAcceleratedCompositingActive; } 378 bool isAcceleratedCompositingActive() const { return m_compositor; } 379 WebPageCompositorPrivate* compositor() const { return m_compositor.get(); } 380 void setCompositor(PassRefPtr<WebPageCompositorPrivate>); 381 bool createCompositor(); 379 382 void destroyCompositor(); 380 383 void syncDestroyCompositorOnCompositingThread(); … … 503 506 bool m_isAcceleratedCompositingActive; 504 507 OwnPtr<FrameLayers> m_frameLayers; // WebKit thread only. 505 OwnPtr<WebPageCompositorPrivate> m_compositor; // Compositing thread only. 508 509 // Compositing thread only, used only when the WebKit layer created the context. 510 // If the API client created the context, this will be null. 511 OwnPtr<GLES2Context> m_ownedContext; 512 513 RefPtr<WebPageCompositorPrivate> m_compositor; // Compositing thread only. 506 514 OwnPtr<WebCore::Timer<WebPagePrivate> > m_rootLayerCommitTimer; 507 515 bool m_needsOneShotDrawingSynchronization; -
trunk/Source/WebKit/blackberry/ChangeLog
r111814 r111959 1 2012-03-23 Arvid Nilsson <anilsson@rim.com> 2 3 [BlackBerry] Add WebPageCompositor class to BlackBerry WebKit API 4 https://bugs.webkit.org/show_bug.cgi?id=81121 5 RIM PR: 136687 6 7 Reviewed by Rob Buis. 8 9 The idea is for the API client to use a WebPageCompositor object to 10 render the WebPage when there's no screen window available. 11 12 The WebPageCompositorPrivate becomes reference counted in order to be 13 kept alive either because it's used for accelerated compositing layers 14 or used for the WebPageCompositor API. It can still work standalone. 15 16 Clean up some code - no need to keep track of a separate boolean 17 WebPagePrivate::m_isAcceleratedCompositingActive when the state of 18 m_compositor can tell you. 19 20 Also remove duplicated code from WebPagePrivate - go directly to the 21 compositor object instead, if you need to draw the AC layers. 22 23 Reviewed internally by Robin Cao and the hasBlitJobs/blitOnIdle change 24 by Filip Spacek. 25 26 * Api/BackingStore.cpp: 27 (BlackBerry::WebKit::BackingStore::hasBlitJobs): 28 (BlackBerry::WebKit::BackingStore::blitOnIdle): 29 (BlackBerry::WebKit::BackingStorePrivate::blitContents): 30 (BlackBerry::WebKit::BackingStorePrivate::drawSubLayers): 31 (BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering): 32 (BlackBerry::WebKit::BackingStorePrivate::surfaceSize): 33 (BlackBerry::WebKit::BackingStorePrivate::buffer): 34 * Api/WebPage.cpp: 35 (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): 36 (BlackBerry::WebKit::WebPagePrivate::drawLayersOnCommit): 37 (BlackBerry::WebKit::WebPagePrivate::setCompositor): 38 (BlackBerry::WebKit::WebPagePrivate::setRootLayerCompositingThread): 39 (BlackBerry::WebKit::WebPagePrivate::createCompositor): 40 (BlackBerry::WebKit::WebPagePrivate::destroyCompositor): 41 * Api/WebPage.h: 42 * Api/WebPageCompositor.cpp: 43 (BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate): 44 (BlackBerry::WebKit::WebPageCompositorPrivate::setContext): 45 (BlackBerry::WebKit::WebPageCompositorPrivate::hardwareCompositing): 46 (BlackBerry::WebKit::WebPageCompositorPrivate::setRootLayer): 47 (BlackBerry::WebKit::WebPageCompositorPrivate::render): 48 (BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers): 49 (BlackBerry::WebKit::WebPageCompositorPrivate::animationTimerFired): 50 (BlackBerry::WebKit::WebPageCompositorPrivate::compositorDestroyed): 51 (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor): 52 (BlackBerry::WebKit::WebPageCompositor::~WebPageCompositor): 53 (BlackBerry::WebKit::WebPageCompositor::client): 54 (BlackBerry::WebKit::WebPageCompositor::prepareFrame): 55 (BlackBerry::WebKit::WebPageCompositor::render): 56 (BlackBerry::WebKit::WebPageCompositor::cleanup): 57 (BlackBerry::WebKit::WebPageCompositor::contextLost): 58 * Api/WebPageCompositor.h: Added. 59 * Api/WebPageCompositorClient.h: Added. 60 * Api/WebPageCompositor_p.h: 61 (BlackBerry::WebKit::WebPageCompositorPrivate::create): 62 (BlackBerry::WebKit::WebPageCompositorPrivate::context): 63 (BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameTimestamp): 64 (BlackBerry::WebKit::WebPageCompositorPrivate::page): 65 (BlackBerry::WebKit::WebPageCompositorPrivate::client): 66 * Api/WebPage_p.h: 67 (BlackBerry::WebKit::WebPagePrivate::client): 68 (BlackBerry::WebKit::WebPagePrivate::isAcceleratedCompositingActive): 69 (BlackBerry::WebKit::WebPagePrivate::compositor): 70 1 71 2012-03-22 Charles Wei <charles.wei@torchmobile.com.cn> 2 72
Note: See TracChangeset
for help on using the changeset viewer.