Changeset 109638 in webkit
- Timestamp:
- Mar 2, 2012 5:22:24 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/BackingStore.cpp
r109592 r109638 202 202 , m_preferredTileMatrixDimension(Vertical) 203 203 , m_blitGeneration(-1) 204 #if USE(ACCELERATED_COMPOSITING) 205 , m_needsDrawLayersOnCommit(false) 206 #endif 204 207 { 205 208 m_frontState = reinterpret_cast<unsigned>(new BackingStoreGeometry); … … 465 468 m_renderQueue->render(!m_suspendRegularRenderJobs); 466 469 467 if (!shouldPerformRegularRenderJobs() || !m_renderQueue->hasCurrentRegularRenderJob()) 468 return; 469 470 m_renderQueue->renderAllCurrentRegularRenderJobs(); 470 if (shouldPerformRegularRenderJobs() && m_renderQueue->hasCurrentRegularRenderJob()) 471 m_renderQueue->renderAllCurrentRegularRenderJobs(); 472 473 #if USE(ACCELERATED_COMPOSITING) 474 drawLayersOnCommitIfNeeded(); 475 #endif 471 476 } 472 477 … … 484 489 485 490 m_renderQueue->render(!m_suspendRegularRenderJobs); 491 492 #if USE(ACCELERATED_COMPOSITING) 493 drawLayersOnCommitIfNeeded(); 494 #endif 486 495 } 487 496 … … 512 521 if (m_renderQueue->hasCurrentRegularRenderJob()) 513 522 m_renderQueue->renderAllCurrentRegularRenderJobs(); 523 524 #if USE(ACCELERATED_COMPOSITING) 525 drawLayersOnCommitIfNeeded(); 526 #endif 514 527 515 528 // Let the caller yield and reschedule the timer. … … 942 955 windowBackBufferState()->addBlittedRegion(screenRect); 943 956 944 #if USE(ACCELERATED_COMPOSITING) && ENABLE_COMPOSITING_SURFACE 957 #if USE(ACCELERATED_COMPOSITING) 958 drawLayersOnCommitIfNeeded(); 959 #if ENABLE_COMPOSITING_SURFACE 945 960 if (m_webPage->d->m_client->window()->windowUsage() != BlackBerry::Platform::Graphics::Window::GLES2Usage) { 946 961 Platform::IntRect clippedRect = intersection(dirtyRect, visibleContentsRect()); 947 962 blendCompositingSurface(clippedRect); 948 963 } 964 #endif 949 965 #endif 950 966 … … 980 996 981 997 Platform::IntRect dirtyContentsRect; 982 const Platform::IntRect contentsRect = Platform::IntRect(Platform::IntPoint(0, 0), m_client->transformedContentsSize());983 const Platform::IntRect viewportRect = Platform::IntRect(Platform::IntPoint(0, 0), m_client->transformedViewportSize());984 998 985 999 for (size_t i = 0; i < tileRectList.size(); ++i) { … … 1107 1121 1108 1122 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) { 1123 #if USE(ACCELERATED_COMPOSITING) 1124 // The blit will call drawSubLayers if necessary 1125 m_needsDrawLayersOnCommit = false; 1126 #endif 1127 1109 1128 BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage( 1110 1129 BlackBerry::Platform::createMethodCallMessage( … … 1197 1216 1198 1217 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) { 1218 #if USE(ACCELERATED_COMPOSITING) 1219 // The blit will call drawSubLayers if necessary 1220 m_needsDrawLayersOnCommit = false; 1221 #endif 1222 1199 1223 BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage( 1200 1224 BlackBerry::Platform::createMethodCallMessage( … … 2132 2156 2133 2157 #if USE(ACCELERATED_COMPOSITING) 2134 m_webPage->d->commitRootLayerIfNeeded(); 2158 // When committing the pending accelerated compositing layer changes, it's 2159 // necessary to draw the new layer appearance. This is normally done as 2160 // part of a blit, but if no blit happens because of this rendering, for 2161 // example because we're rendering an offscreen rectangle, someone needs to 2162 // catch this flag and make sure those layers get drawn. 2163 // This is just a complicated way to do 2164 // "if (commitRootLayerIfNeeded()) drawLayersOnCommit();" 2165 if (m_webPage->d->commitRootLayerIfNeeded()) 2166 m_needsDrawLayersOnCommit = true; 2135 2167 #endif 2136 2168 … … 2484 2516 return m_webPage->d->drawSubLayers(dst, contentsRect); 2485 2517 } 2518 2519 bool BackingStorePrivate::drawLayersOnCommitIfNeeded() 2520 { 2521 // Check if rendering caused a commit and we need to redraw the layers 2522 if (!m_needsDrawLayersOnCommit) 2523 return false; 2524 2525 m_needsDrawLayersOnCommit = false; 2526 m_webPage->d->drawLayersOnCommit(); 2527 2528 return true; 2529 } 2486 2530 #endif 2487 2531 -
trunk/Source/WebKit/blackberry/Api/BackingStore_p.h
r107737 r109638 197 197 void clearCompositingSurface(); 198 198 bool drawSubLayers(); 199 bool drawLayersOnCommitIfNeeded(); 200 // WebPage will call this when drawing layers to tell us we don't need to 201 void willDrawLayersOnCommit() { m_needsDrawLayersOnCommit = false; } 199 202 #endif 200 203 … … 348 351 pthread_cond_t m_blitGenerationCond; 349 352 struct timespec m_currentBlitEnd; 353 354 #if USE(ACCELERATED_COMPOSITING) 355 mutable bool m_needsDrawLayersOnCommit; // Not thread safe, WebKit thread only 356 #endif 350 357 }; 351 358 } // namespace WebKit -
trunk/Source/WebKit/blackberry/ChangeLog
r109592 r109638 1 2012-03-02 Arvid Nilsson <anilsson@rim.com> 2 3 Accelerated compositing: Checkerboard never goes away 4 https://bugs.webkit.org/show_bug.cgi?id=79020 5 RIM PR #134164 6 7 Reviewed by Adam Treat. 8 9 Checkerboard appears in accelerated compositing layers when there's no 10 texture for (part of) a layer. The layer renderer queues up some render 11 jobs and schedules a commit to make the WebKit thread process those 12 jobs. Render jobs performed during commit cause texture upload jobs to 13 be scheduled on the UI thread. Texture uploads are performed when next 14 drawing the layers. 15 16 Unfortunately, sometimes commit operation happens without a subsequent 17 call draw the layers. 18 19 In order to implement one-shot drawing sync, I added a call to 20 commitRootLayerIfNeeded() in BackingStore::renderContents(), and 21 I was lucky that most of the time, renderContents() is followed by 22 blit(Visible)Contents() which in turn draws the layers. 23 However, render is not always followed by a blit, for example when 24 rendering offscreen tiles in BackingStore::renderOnIdle(), and in 25 direct rendering mode. 26 27 Fixed by making sure that every call to commitRootLayerIfNeeded() that 28 returns true is followed by a call to drawLayersOnCommit(), unless a 29 blit was requested already. 30 31 Also tweak the logic for one-shot drawing sync to make the code in 32 drawLayersOnCommit() reusable outside of rootLayerCommitTimerFired(). 33 34 * Api/BackingStore.cpp: 35 (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate): 36 (BlackBerry::WebKit::BackingStorePrivate::renderOnTimer): 37 (BlackBerry::WebKit::BackingStorePrivate::renderOnIdle): 38 (BlackBerry::WebKit::BackingStorePrivate::willFireTimer): 39 (BlackBerry::WebKit::BackingStorePrivate::renderDirectToWindow): 40 (BlackBerry::WebKit::BackingStorePrivate::render): 41 (BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents): 42 (BlackBerry::WebKit::BackingStorePrivate::blitContents): 43 (BlackBerry::WebKit::BackingStorePrivate::renderContents): 44 (WebKit): 45 (BlackBerry::WebKit::BackingStorePrivate::drawLayersOnCommitIfNeeded): 46 * Api/BackingStore_p.h: 47 (BackingStorePrivate): 48 (BlackBerry::WebKit::BackingStorePrivate::willDrawLayersOnCommit): 49 1 50 2012-03-02 Adam Treat <atreat@rim.com> 2 51
Note: See TracChangeset
for help on using the changeset viewer.