Changeset 142677 in webkit
- Timestamp:
- Feb 12, 2013 3:09:10 PM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/BackingStore.cpp
r142670 r142677 220 220 , m_hasBlitJobs(false) 221 221 , m_webPageBackgroundColor(WebCore::Color::white) 222 , m_currentWindowBackBuffer(0)223 222 , m_preferredTileMatrixDimension(Vertical) 224 #if USE(ACCELERATED_COMPOSITING)225 , m_isDirectRenderingAnimationMessageScheduled(false)226 #endif227 223 { 228 224 m_frontState = reinterpret_cast<unsigned>(new BackingStoreGeometry); … … 253 249 { 254 250 WebCore::InspectorInstrumentation::didCancelFrame(WebPagePrivate::core(m_webPage)); 255 }256 257 bool BackingStorePrivate::shouldDirectRenderingToWindow() const258 {259 // Direct rendering doesn't work with OpenGL compositing code paths due to260 // a race condition on which thread's EGL context gets to make the surface261 // current, see PR 105750.262 // As a workaround, we will be using compositor to draw the root layer.263 if (isOpenGLCompositing())264 return false;265 266 if (m_webPage->settings()->isDirectRenderingToWindowEnabled())267 return true;268 269 // If the BackingStore is inactive, see if there's a compositor to do the270 // work of rendering the root layer.271 if (!isActive())272 return !m_webPage->d->compositorDrawsRootLayer();273 274 const BackingStoreGeometry* geometry = frontState();275 const unsigned tilesNecessary = minimumNumberOfTilesWide() * minimumNumberOfTilesHigh();276 const unsigned tilesAvailable = geometry->numberOfTilesWide() * geometry->numberOfTilesHigh();277 return tilesAvailable < tilesNecessary;278 251 } 279 252 … … 417 390 #endif 418 391 419 // For the direct rendering case, there is no such operation as blit,420 // we have to render to get anything to the screen.421 if (shouldDirectRenderingToWindow() && op == BackingStore::Blit)422 op = BackingStore::RenderAndBlit;423 424 392 // Render visible contents if necessary. 425 393 if (op == BackingStore::RenderAndBlit) { 426 if (shouldDirectRenderingToWindow()) 427 renderDirectToWindow(visibleContentsRect()); 428 else { 429 updateTileMatrixIfNeeded(); 430 TileIndexList visibleTiles = visibleTileIndexes(frontState()); 431 TileIndexList renderedTiles = render(visibleTiles); 432 433 if (renderedTiles.size() != visibleTiles.size()) { 434 // Add unrendered leftover tiles to the render queue. 435 for (unsigned i = 0; i < visibleTiles.size(); ++i) { 436 if (!renderedTiles.contains(visibleTiles[i])) { 437 Platform::IntRect tileRect(frontState()->originOfTile(visibleTiles[i]), tileSize()); 438 m_renderQueue->addToQueue(RenderQueue::VisibleZoom, tileRect); 439 } 394 updateTileMatrixIfNeeded(); 395 TileIndexList visibleTiles = visibleTileIndexes(frontState()); 396 TileIndexList renderedTiles = render(visibleTiles); 397 398 if (renderedTiles.size() != visibleTiles.size()) { 399 // Add unrendered leftover tiles to the render queue. 400 for (unsigned i = 0; i < visibleTiles.size(); ++i) { 401 if (!renderedTiles.contains(visibleTiles[i])) { 402 Platform::IntRect tileRect(frontState()->originOfTile(visibleTiles[i]), tileSize()); 403 m_renderQueue->addToQueue(RenderQueue::VisibleZoom, tileRect); 440 404 } 441 405 } … … 460 424 #else 461 425 // Do some blitting if necessary. 462 if ( (op == BackingStore::Blit || op == BackingStore::RenderAndBlit) && !shouldDirectRenderingToWindow())426 if (op == BackingStore::Blit || op == BackingStore::RenderAndBlit) 463 427 blitVisibleContents(); 464 428 #endif … … 474 438 bool shouldSuspend = m_suspendScreenUpdateCounterWebKitThread 475 439 || !m_webPage->isVisible() 476 || (!isBackingStoreUsable && !m_webPage->d->compositorDrawsRootLayer() && !shouldDirectRenderingToWindow());440 || (!isBackingStoreUsable && !m_webPage->d->compositorDrawsRootLayer()); 477 441 478 442 if (m_suspendScreenUpdatesWebKitThread == shouldSuspend) … … 543 507 else { 544 508 m_renderQueue->addToQueue(RenderQueue::VisibleScroll, rect); 545 // We only blit here if the client did not generate the scroll as the client546 // nowsupports blitting asynchronously during scroll operations.547 if (!m_client->isClientGeneratedScroll() && !shouldDirectRenderingToWindow())509 // We only blit here if the client did not generate the scroll as the 510 // client supports blitting asynchronously during scroll operations. 511 if (!m_client->isClientGeneratedScroll()) 548 512 blitVisibleContents(); 549 513 } … … 561 525 { 562 526 ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread()); 563 564 // If we are direct rendering then we are forced to go down the slow path565 // to scrolling.566 if (shouldDirectRenderingToWindow()) {567 Platform::IntRect viewportRect(Platform::IntPoint(0, 0), m_webPage->d->transformedViewportSize());568 slowScroll(delta, m_webPage->d->mapFromTransformed(viewportRect), true /*immediate*/);569 return;570 }571 527 572 528 #if DEBUG_BACKINGSTORE … … 616 572 bool BackingStorePrivate::shouldPerformRenderJobs() const 617 573 { 618 return (isActive() || shouldDirectRenderingToWindow()) && !m_suspendRenderJobs && !m_suspendBackingStoreUpdates && !m_renderQueue->isEmpty(!m_suspendRegularRenderJobs);574 return isActive() && !m_suspendRenderJobs && !m_suspendBackingStoreUpdates && !m_renderQueue->isEmpty(!m_suspendRegularRenderJobs); 619 575 } 620 576 … … 1052 1008 } 1053 1009 1054 Platform::IntRect BackingStorePrivate::renderDirectToWindow(const Platform::IntRect& rect)1055 {1056 requestLayoutIfNeeded();1057 1058 Platform::IntRect dirtyRect = rect;1059 dirtyRect.intersect(unclippedVisibleContentsRect());1060 1061 if (dirtyRect.isEmpty())1062 return Platform::IntRect();1063 1064 Platform::ViewportAccessor* viewportAccessor = m_webPage->webkitThreadViewportAccessor();1065 Platform::IntRect screenRect = viewportAccessor->pixelViewportFromContents(dirtyRect);1066 windowFrontBufferState()->clearBlittedRegion(screenRect);1067 1068 paintDefaultBackground(dirtyRect, viewportAccessor, true /*flush*/);1069 1070 if (!renderContents(buffer(), screenRect, viewportAccessor->scale(), viewportAccessor->documentFromPixelContents(dirtyRect.location())))1071 return Platform::IntRect();1072 1073 windowBackBufferState()->addBlittedRegion(screenRect);1074 1075 #if USE(ACCELERATED_COMPOSITING)1076 m_isDirectRenderingAnimationMessageScheduled = false;1077 1078 if (m_webPage->d->isAcceleratedCompositingActive()) {1079 BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(1080 BlackBerry::Platform::createMethodCallMessage(1081 &BackingStorePrivate::drawAndBlendLayersForDirectRendering,1082 this, dirtyRect));1083 }1084 #endif1085 1086 invalidateWindow(screenRect);1087 m_renderQueue->clear(rect, RenderQueue::DontClearCompletedJobs);1088 return dirtyRect;1089 }1090 1091 1010 TileIndexList BackingStorePrivate::render(const TileIndexList& tileIndexList) 1092 1011 { … … 1096 1015 requestLayoutIfNeeded(); 1097 1016 1098 if (shouldDirectRenderingToWindow()) { 1099 // We cannot handle tiles in direct rendering mode. Bad function call. 1100 ASSERT(false); 1101 return TileIndexList(); 1102 } 1103 1104 // If direct rendering is off, even though we're not active, someone else 1105 // has to render the root layer. There are no tiles available for us to 1106 // draw to. 1017 // If no tiles available for us to draw to, someone else has to render the root layer. 1107 1018 if (!isActive()) 1108 1019 return TileIndexList(); … … 1236 1147 void BackingStorePrivate::renderAndBlitImmediately(const Platform::IntRect& rect) 1237 1148 { 1238 if (shouldDirectRenderingToWindow()) {1239 renderDirectToWindow(rect);1240 return;1241 }1242 1243 1149 updateTileMatrixIfNeeded(); 1244 1150 m_renderQueue->addToQueue(RenderQueue::VisibleZoom, rect); 1245 1151 renderJob(); 1246 }1247 1248 void BackingStorePrivate::copyPreviousContentsToBackSurfaceOfWindow()1249 {1250 Platform::IntRectRegion previousContentsRegion1251 = Platform::IntRectRegion::subtractRegions(windowFrontBufferState()->blittedRegion(), windowBackBufferState()->blittedRegion());1252 1253 if (previousContentsRegion.isEmpty())1254 return;1255 1256 if (Window* window = m_webPage->client()->window())1257 window->copyFromFrontToBack(previousContentsRegion);1258 windowBackBufferState()->addBlittedRegion(previousContentsRegion);1259 1152 } 1260 1153 … … 1293 1186 void BackingStorePrivate::blitVisibleContents(bool force) 1294 1187 { 1295 // Blitting must never happen for direct rendering case.1296 // Use invalidateWindow() instead.1297 ASSERT(!shouldDirectRenderingToWindow());1298 if (shouldDirectRenderingToWindow()) {1299 Platform::logAlways(Platform::LogLevelCritical,1300 "BackingStore::blitVisibleContents operation not supported in direct rendering mode");1301 return;1302 }1303 1304 1188 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) { 1305 1189 BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage( … … 2090 1974 ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()); 2091 1975 2092 windowFrontBufferState()->clearBlittedRegion(dstRect);2093 windowBackBufferState()->addBlittedRegion(dstRect);2094 2095 1976 BlackBerry::Platform::Graphics::Buffer* dstBuffer = buffer(); 2096 1977 ASSERT(dstBuffer); … … 2115 1996 { 2116 1997 ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()); 2117 2118 windowFrontBufferState()->clearBlittedRegion(dstRect);2119 windowBackBufferState()->addBlittedRegion(dstRect);2120 1998 2121 1999 BlackBerry::Platform::Graphics::Buffer* dstBuffer = buffer(); … … 2156 2034 } 2157 2035 2158 void BackingStorePrivate::invalidateWindow()2159 {2160 // Grab a rect appropriate for the current thread.2161 if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {2162 if (m_webPage->client()->userInterfaceViewportAccessor())2163 invalidateWindow(m_webPage->client()->userInterfaceViewportAccessor()->destinationSurfaceRect());2164 } else2165 invalidateWindow(Platform::IntRect(Platform::IntPoint(0, 0), m_client->transformedViewportSize()));2166 }2167 2168 2036 void BackingStorePrivate::invalidateWindow(const Platform::IntRect& dst) 2169 2037 { 2038 ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()); 2039 2170 2040 if (dst.isEmpty()) 2171 2041 return; 2172 2173 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread() && !shouldDirectRenderingToWindow()) {2174 // This needs to be sync in order to swap the recently drawn thing...2175 // This will only be called from WebKit thread during direct rendering.2176 typedef void (BlackBerry::WebKit::BackingStorePrivate::*FunctionType)(const Platform::IntRect&);2177 BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(2178 BlackBerry::Platform::createMethodCallMessage<FunctionType, BackingStorePrivate, Platform::IntRect>(2179 &BackingStorePrivate::invalidateWindow, this, dst));2180 return;2181 }2182 2042 2183 2043 #if DEBUG_BACKINGSTORE … … 2187 2047 #endif 2188 2048 2189 // Since our window may also be double buffered, we need to also copy the2190 // front buffer's contents to the back buffer before we swap them. It is2191 // analogous to what we do with our double buffered tiles by calling2192 // copyPreviousContentsToBackingSurfaceOfTile(). It only affects partial2193 // screen updates since when we are scrolling or zooming, the whole window2194 // is invalidated anyways and no copying is needed.2195 copyPreviousContentsToBackSurfaceOfWindow();2196 2197 2049 Platform::IntRect dstRect = dst; 2198 2050 2199 Platform::IntRect viewportRect(Platform::IntPoint(0, 0), m_client->transformedViewportSize());2200 dstRect.intersect( viewportRect);2051 Platform::IntRect surfaceRect(Platform::IntPoint(0, 0), surfaceSize()); 2052 dstRect.intersect(surfaceRect); 2201 2053 2202 2054 if (dstRect.width() <= 0 || dstRect.height() <= 0) … … 2209 2061 #endif 2210 2062 2211 m_currentWindowBackBuffer = (m_currentWindowBackBuffer + 1) % 2;2212 2063 if (Window* window = m_webPage->client()->window()) 2213 2064 window->post(dstRect); … … 2220 2071 unsigned char alpha) 2221 2072 { 2222 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread() && !shouldDirectRenderingToWindow()) {2073 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) { 2223 2074 typedef void (BlackBerry::WebKit::BackingStorePrivate::*FunctionType)(const Platform::IntRect&, 2224 2075 unsigned char, … … 2243 2094 Platform::logAlways(Platform::LogLevelWarn, "Empty window buffer, couldn't clearWindow"); 2244 2095 2245 windowFrontBufferState()->clearBlittedRegion(rect);2246 windowBackBufferState()->addBlittedRegion(rect);2247 2248 2096 BlackBerry::Platform::Graphics::clearBuffer(dstBuffer, rect, red, green, blue, alpha); 2249 2097 } … … 2277 2125 m_renderQueue->setCurrentRegularRenderJobBatchUnderPressure(false); 2278 2126 #if ENABLE_SCROLLBARS 2279 else if (shouldBlit && !shouldDirectRenderingToWindow())2127 else if (shouldBlit) 2280 2128 blitVisibleContents(); 2281 2129 #endif … … 2345 2193 } 2346 2194 2347 BackingStoreWindowBufferState* BackingStorePrivate::windowFrontBufferState() const2348 {2349 return &m_windowBufferState[(m_currentWindowBackBuffer + 1) % 2];2350 }2351 2352 BackingStoreWindowBufferState* BackingStorePrivate::windowBackBufferState() const2353 {2354 return &m_windowBufferState[m_currentWindowBackBuffer];2355 }2356 2357 #if USE(ACCELERATED_COMPOSITING)2358 void BackingStorePrivate::drawAndBlendLayersForDirectRendering(const Platform::IntRect& dirtyRect)2359 {2360 ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread());2361 if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread())2362 return;2363 2364 // Because we're being called sync from the WebKit thread, we can use2365 // regular WebPage size and transformation functions without concerns.2366 WebCore::IntRect contentsRect = visibleContentsRect();2367 WebCore::FloatRect untransformedContentsRect = m_webPage->d->mapFromTransformedFloatRect(WebCore::FloatRect(contentsRect));2368 WebCore::IntRect contentsScreenRect = m_client->mapFromTransformedContentsToTransformedViewport(contentsRect);2369 WebCore::IntRect dstRect = intersection(contentsScreenRect,2370 WebCore::IntRect(WebCore::IntPoint(0, 0), m_webPage->d->transformedViewportSize()));2371 2372 // Check if rendering caused a commit and we need to redraw the layers.2373 if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor())2374 compositor->drawLayers(dstRect, untransformedContentsRect);2375 }2376 #endif2377 2378 2195 // static 2379 2196 void BackingStorePrivate::setCurrentBackingStoreOwner(WebPage* webPage) … … 2396 2213 void BackingStorePrivate::didRenderContent(const Platform::IntRectRegion& renderedRegion) 2397 2214 { 2398 if (!shouldDirectRenderingToWindow()) {2399 2215 #if USE(ACCELERATED_COMPOSITING) 2400 if (m_webPage->d->needsOneShotDrawingSynchronization()) 2401 m_webPage->d->commitRootLayerIfNeeded(); 2402 else 2403 #endif 2404 { 2405 if (isScrollingOrZooming()) 2406 return; // don't drag down framerates by double-blitting. 2407 2408 blitVisibleContents(); 2409 } 2410 } else 2411 invalidateWindow(); 2216 if (m_webPage->d->needsOneShotDrawingSynchronization()) 2217 m_webPage->d->commitRootLayerIfNeeded(); 2218 else 2219 #endif 2220 { 2221 if (isScrollingOrZooming()) 2222 return; // don't drag down framerates by double-blitting. 2223 2224 blitVisibleContents(); 2225 } 2412 2226 2413 2227 // Don't issue content rendered calls when all we rendered was filler … … 2500 2314 } 2501 2315 2502 bool BackingStore::isDirectRenderingToWindow() const2503 {2504 BackingStoreMutexLocker locker(d);2505 return d->shouldDirectRenderingToWindow();2506 }2507 2508 2316 void BackingStore::acquireBackingStoreMemory() 2509 2317 { -
trunk/Source/WebKit/blackberry/Api/BackingStore.h
r142670 r142677 77 77 void blitOnIdle(); 78 78 79 bool isDirectRenderingToWindow() const;80 81 79 void acquireBackingStoreMemory(); 82 80 void releaseOwnedBackingStoreMemory(); -
trunk/Source/WebKit/blackberry/Api/BackingStore_p.h
r142670 r142677 90 90 }; 91 91 92 class BackingStoreWindowBufferState {93 public:94 Platform::IntRectRegion blittedRegion() const { return m_blittedRegion; }95 void addBlittedRegion(const Platform::IntRectRegion& region)96 {97 m_blittedRegion = Platform::IntRectRegion::unionRegions(m_blittedRegion, region);98 }99 void clearBlittedRegion(const Platform::IntRectRegion& region)100 {101 m_blittedRegion = Platform::IntRectRegion::subtractRegions(m_blittedRegion, region);102 }103 void clearBlittedRegion() { m_blittedRegion = Platform::IntRectRegion(); }104 105 bool isRendered(const Platform::IntPoint& scrollPosition, const Platform::IntRectRegion& contents) const106 {107 return Platform::IntRectRegion::subtractRegions(contents, m_blittedRegion).isEmpty();108 }109 110 private:111 Platform::IntRectRegion m_blittedRegion;112 };113 114 92 class BackingStorePrivate : public BlackBerry::Platform::GuardedPointerBase { 115 93 public: … … 119 97 void instrumentBeginFrame(); 120 98 void instrumentCancelFrame(); 121 122 // Returns whether direct rendering is explicitly turned on or is123 // required because the surface pool is not large enough to meet124 // the minimum number of tiles required to scroll.125 bool shouldDirectRenderingToWindow() const;126 99 127 100 // Returns whether we're using the OpenGL code path for compositing the … … 200 173 void scrollBackingStore(int deltaX, int deltaY); 201 174 202 // Render the given dirty rect and invalidate the screen.203 Platform::IntRect renderDirectToWindow(const Platform::IntRect&);204 205 175 // Render the given tiles if enough back buffers are available. 206 176 // Return the actual set of rendered tiles. … … 217 187 void renderAndBlitVisibleContentsImmediately(); 218 188 void renderAndBlitImmediately(const Platform::IntRect&); 189 void paintDefaultBackground(const Platform::IntRect& dstRect, BlackBerry::Platform::ViewportAccessor*, bool flush); 219 190 void blitVisibleContents(bool force = false); 220 221 // Assumes the rect to be in window/viewport coordinates.222 void copyPreviousContentsToBackSurfaceOfWindow();223 void copyPreviousContentsToTileBuffer(const Platform::IntRect& excludeRect, TileBuffer* dstTileBuffer, TileBuffer* srcTileBuffer);224 void paintDefaultBackground(const Platform::IntRect& dstRect, BlackBerry::Platform::ViewportAccessor*, bool flush);225 191 void blitOnIdle(); 226 192 … … 236 202 237 203 bool drawLayersOnCommitIfNeeded(); 238 void drawAndBlendLayersForDirectRendering(const Platform::IntRect& dirtyRect);239 204 // WebPage will call this when drawing layers to tell us we don't need to 240 205 void willDrawLayersOnCommit() { m_needsDrawLayersOnCommit = false; } 241 // WebPageCompositor uses this to cut down on excessive message sending.242 bool isDirectRenderingAnimationMessageScheduled() { return m_isDirectRenderingAnimationMessageScheduled; }243 void setDirectRenderingAnimationMessageScheduled() { m_isDirectRenderingAnimationMessageScheduled = true; }244 206 #endif 245 207 … … 322 284 void setWebPageBackgroundColor(const WebCore::Color&); 323 285 324 void invalidateWindow();325 286 void invalidateWindow(const Platform::IntRect& dst); 326 287 void clearWindow(const Platform::IntRect&, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha = 255); … … 334 295 BackingStoreGeometry* frontState() const; 335 296 void adoptAsFrontState(BackingStoreGeometry* newFrontState); 336 337 BackingStoreWindowBufferState* windowFrontBufferState() const;338 BackingStoreWindowBufferState* windowBackBufferState() const;339 297 340 298 static void setCurrentBackingStoreOwner(WebPage*); … … 373 331 mutable unsigned m_frontState; 374 332 375 unsigned m_currentWindowBackBuffer;376 mutable BackingStoreWindowBufferState m_windowBufferState[2];377 378 333 TileMatrixDirection m_preferredTileMatrixDimension; 379 334 … … 384 339 #if USE(ACCELERATED_COMPOSITING) 385 340 mutable bool m_needsDrawLayersOnCommit; // Not thread safe, WebKit thread only 386 bool m_isDirectRenderingAnimationMessageScheduled;387 341 #endif 388 342 -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r142482 r142677 1 1 /* 2 * Copyright (C) 2009, 2010, 2011, 2012 Research In Motion Limited. All rights reserved.2 * Copyright (C) 2009, 2010, 2011, 2012, 2013 Research In Motion Limited. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 3568 3568 ASSERT(m_webPage->isVisible()); 3569 3569 3570 bool directRendering = m_backingStore->d->shouldDirectRenderingToWindow(); 3571 if (!m_backingStore->d->isActive() 3572 || shouldResetTilesWhenShown() 3573 || directRendering) { 3570 if (!m_backingStore->d->isActive() || shouldResetTilesWhenShown()) { 3574 3571 BackingStorePrivate::setCurrentBackingStoreOwner(m_webPage); 3575 3572 … … 3649 3646 3650 3647 bool hasPendingOrientation = m_pendingOrientation != -1; 3651 3652 // The window buffers might have been recreated, cleared, moved, etc., so:3653 m_backingStore->d->windowFrontBufferState()->clearBlittedRegion();3654 m_backingStore->d->windowBackBufferState()->clearBlittedRegion();3655 3648 3656 3649 IntSize viewportSizeBefore = actualVisibleSize(); … … 3807 3800 // FIXME: Determine why the above comment says "clamping on", yet we 3808 3801 // don't set enforceScaleClamping to true. 3809 // FIXME: Determine why ensureContentVisible() is only called for !success 3810 // in the direct-rendering case, but in all cases otherwise. Chances are 3811 // one of these is incorrect and we can unify two branches into one. 3812 if (m_backingStore->d->shouldDirectRenderingToWindow()) { 3813 bool success = zoomAboutPoint(scale, anchor, false /* enforceScaleClamping */, true /* forceRendering */); 3814 if (!success && ensureFocusElementVisible) 3815 ensureContentVisible(!newVisibleRectContainsOldVisibleRect); 3816 3817 } else if (zoomAboutPoint(scale, anchor, false /*enforceScaleClamping*/, true /*forceRendering*/)) { 3802 if (zoomAboutPoint(scale, anchor, false /*enforceScaleClamping*/, true /*forceRendering*/)) { 3818 3803 if (ensureFocusElementVisible) 3819 3804 ensureContentVisible(!newVisibleRectContainsOldVisibleRect); 3820 3821 3805 } else { 3822 3823 3806 // Suspend all updates to the backingstore. 3824 3807 m_backingStore->d->suspendBackingStoreUpdates(); … … 5608 5591 // backing store is never necessary, because the backing store draws 5609 5592 // nothing. 5610 if (!compositorDrawsRootLayer()) { 5611 // If we are doing direct rendering and have a single rendering target, 5612 // committing is equivalent to a one shot drawing synchronization. 5613 // We need to re-render the web page, re-render the layers, and 5614 // then blit them on top of the re-rendered web page. 5615 if (m_backingStore->d->isOpenGLCompositing() && m_backingStore->d->shouldDirectRenderingToWindow()) 5616 setNeedsOneShotDrawingSynchronization(); 5617 5618 if (needsOneShotDrawingSynchronization()) { 5593 if (!compositorDrawsRootLayer() && needsOneShotDrawingSynchronization()) { 5619 5594 #if DEBUG_AC_COMMIT 5620 Platform::logAlways(Platform::LogLevelCritical, 5621 "%s: OneShotDrawingSynchronization code path!", 5622 WTF_PRETTY_FUNCTION); 5623 #endif 5624 const IntRect windowRect = IntRect(IntPoint::zero(), viewportSize()); 5625 m_backingStore->d->repaint(windowRect, true /*contentChanged*/, true /*immediate*/); 5626 return; 5627 } 5595 Platform::logAlways(Platform::LogLevelCritical, 5596 "%s: OneShotDrawingSynchronization code path!", 5597 WTF_PRETTY_FUNCTION); 5598 #endif 5599 const IntRect windowRect = IntRect(IntPoint::zero(), viewportSize()); 5600 m_backingStore->d->repaint(windowRect, true /*contentChanged*/, true /*immediate*/); 5601 return; 5628 5602 } 5629 5603 … … 6052 6026 6053 6027 #if USE(ACCELERATED_COMPOSITING) 6054 void WebPagePrivate::blitVisibleContents()6055 {6056 if (m_backingStore->d->shouldDirectRenderingToWindow())6057 return;6058 6059 m_backingStore->d->blitVisibleContents();6060 }6061 6062 6028 void WebPagePrivate::scheduleCompositingRun() 6063 6029 { … … 6068 6034 } 6069 6035 6070 blitVisibleContents(); 6071 } 6072 6036 m_backingStore->d->blitVisibleContents(); 6037 } 6073 6038 #endif 6074 6039 -
trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
r140816 r142677 234 234 } 235 235 236 if (backingStore->d->shouldDirectRenderingToWindow()) {237 if (backingStore->d->isDirectRenderingAnimationMessageScheduled())238 return; // don't send new messages as long as we haven't rerendered239 240 using namespace BlackBerry::Platform;241 242 backingStore->d->setDirectRenderingAnimationMessageScheduled();243 webKitThreadMessageClient()->dispatchMessage(createMethodCallMessage(&BackingStorePrivate::renderAndBlitVisibleContentsImmediately, backingStore->d));244 return;245 }246 247 236 if (!m_webPage->needsOneShotDrawingSynchronization()) 248 m_webPage->blitVisibleContents();237 backingStore->blitVisibleContents(); 249 238 } 250 239 -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r142220 r142677 422 422 void suspendRootLayerCommit(); 423 423 void resumeRootLayerCommit(); 424 void blitVisibleContents();425 424 426 425 void scheduleCompositingRun(); -
trunk/Source/WebKit/blackberry/Api/WebSettings.cpp
r141481 r142677 41 41 DEFINE_STATIC_LOCAL(String, BlackBerryBackgroundColor, (ASCIILiteral("BlackBerryBackgroundColor"))); 42 42 DEFINE_STATIC_LOCAL(String, BlackBerryCookiesEnabled, (ASCIILiteral("BlackBerryCookiesEnabled"))); 43 DEFINE_STATIC_LOCAL(String, BlackBerryDirectRenderingToWindowEnabled, (ASCIILiteral("BlackBerryDirectRenderingToWindowEnabled")));44 43 DEFINE_STATIC_LOCAL(String, BlackBerryDrawBorderWhileLoadingImages, (ASCIILiteral("BlackBerryDrawBorderWhileLoadingImages"))); 45 44 DEFINE_STATIC_LOCAL(String, BlackBerryEmailModeEnabled, (ASCIIliteral("BlackBerryEmailModeEnabled"))); … … 745 744 } 746 745 747 bool WebSettings::isDirectRenderingToWindowEnabled() const748 {749 return m_private->getBoolean(BlackBerryDirectRenderingToWindowEnabled);750 }751 752 void WebSettings::setDirectRenderingToWindowEnabled(bool enable)753 {754 m_private->setBoolean(BlackBerryDirectRenderingToWindowEnabled, enable);755 }756 757 746 bool WebSettings::isBackingStoreEnabled() const 758 747 { -
trunk/Source/WebKit/blackberry/Api/WebSettings.h
r141481 r142677 215 215 void setFrameFlatteningEnabled(bool); 216 216 217 bool isDirectRenderingToWindowEnabled() const;218 void setDirectRenderingToWindowEnabled(bool);219 220 217 unsigned maxPluginInstances() const; 221 218 void setMaxPluginInstances(unsigned num); -
trunk/Source/WebKit/blackberry/ChangeLog
r142670 r142677 1 2013-02-12 Jakob Petsovits <jpetsovits@rim.com> 2 3 [BlackBerry] Eliminate the direct rendering option. 4 https://bugs.webkit.org/show_bug.cgi?id=109608 5 RIM PR 293298 6 7 Reviewed by Rob Buis. 8 Internally reviewed by Arvid Nilsson. 9 10 It added a lot of complexity and we're not going to use it anymore. 11 This patch removes direct rendering functionality from 12 WebKit/blackberry together with the assumption that blitting on the 13 WebKit thread is possible or acceptable. It now isn't anymore. 14 15 * Api/BackingStore.cpp: 16 (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate): 17 (BlackBerry::WebKit::BackingStorePrivate::resumeScreenUpdates): 18 (BlackBerry::WebKit::BackingStorePrivate::updateSuspendScreenUpdateState): 19 (BlackBerry::WebKit::BackingStorePrivate::slowScroll): 20 (BlackBerry::WebKit::BackingStorePrivate::scroll): 21 (BlackBerry::WebKit::BackingStorePrivate::shouldPerformRenderJobs): 22 (BlackBerry::WebKit::BackingStorePrivate::render): 23 (BlackBerry::WebKit::BackingStorePrivate::renderAndBlitImmediately): 24 (BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents): 25 (BlackBerry::WebKit::BackingStorePrivate::blitToWindow): 26 (BlackBerry::WebKit::BackingStorePrivate::fillWindow): 27 (BlackBerry::WebKit::BackingStorePrivate::invalidateWindow): 28 (BlackBerry::WebKit::BackingStorePrivate::clearWindow): 29 (BlackBerry::WebKit::BackingStorePrivate::setScrollingOrZooming): 30 (BlackBerry::WebKit::BackingStorePrivate::didRenderContent): 31 * Api/BackingStore.h: 32 * Api/BackingStore_p.h: 33 (BackingStorePrivate): 34 * Api/WebPage.cpp: 35 (BlackBerry::WebKit::WebPagePrivate::resumeBackingStore): 36 (BlackBerry::WebKit::WebPagePrivate::setViewportSize): 37 (BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired): 38 (WebKit): 39 (BlackBerry::WebKit::WebPagePrivate::scheduleCompositingRun): 40 * Api/WebPageCompositor.cpp: 41 (BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged): 42 * Api/WebPage_p.h: 43 (WebPagePrivate): 44 * Api/WebSettings.cpp: 45 (WebKit): 46 * Api/WebSettings.h: 47 * WebKitSupport/RenderQueue.cpp: 48 (BlackBerry::WebKit::RenderQueue::renderRegularRenderJobs): 49 (BlackBerry::WebKit::RenderQueue::renderScrollZoomJobs): 50 * WebKitSupport/SurfacePool.cpp: 51 (BlackBerry::WebKit::SurfacePool::initialize): 52 1 53 2013-02-12 Andrew Lo <anlo@rim.com> 2 54 -
trunk/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp
r142670 r142677 628 628 } 629 629 630 bool shouldDirectRenderingToWindow = m_parent->shouldDirectRenderingToWindow();631 630 Platform::IntRect contentsRect = m_parent->expandedContentsRect(); 632 631 … … 637 636 638 637 // Split the current regular render job region into tiles. 639 if (!shouldDirectRenderingToWindow) { 640 // Discard regions outside of the region covered by these tiles. 641 // They'll be rendered when the geometry changes. 642 m_regularRenderJobsRegion = Platform::IntRectRegion::intersectRegions(m_regularRenderJobsRegion, m_parent->frontState()->backingStoreRect()); 643 m_currentRegularRenderJobsBatch = tileIndexesIntersectingRegion(m_regularRenderJobsRegion, m_parent->frontState()); 644 } 638 // Discard regions outside of the region covered by these tiles. 639 // They'll be rendered when the geometry changes. 640 m_regularRenderJobsRegion = Platform::IntRectRegion::intersectRegions(m_regularRenderJobsRegion, m_parent->frontState()->backingStoreRect()); 641 m_currentRegularRenderJobsBatch = tileIndexesIntersectingRegion(m_regularRenderJobsRegion, m_parent->frontState()); 645 642 646 643 // Create a region object that will be checked when adding new rects before … … 666 663 TileIndexList tilesToRender; 667 664 668 unsigned numberOfAvailableBackBuffers = shouldDirectRenderingToWindow 669 ? 0 670 : SurfacePool::globalSurfacePool()->numberOfAvailableBackBuffers(); 665 unsigned numberOfAvailableBackBuffers = SurfacePool::globalSurfacePool()->numberOfAvailableBackBuffers(); 671 666 672 667 while (!outstandingJobs->isEmpty() && numberOfAvailableBackBuffers) { … … 751 746 } 752 747 753 Platform::IntRectRegion renderedRegion; 754 755 if (shouldDirectRenderingToWindow) { 756 // Try rendering once, if we're suspended there will be another 757 // full-screen update later on anyways. 758 renderedRegion = m_parent->renderDirectToWindow(m_currentRegularRenderJobsBatchRegion.extents()); 759 m_currentRegularRenderJobsBatchRegion = Platform::IntRectRegion(); 760 } else { 761 renderedRegion = tileRegion(completedJobs, m_parent->frontState()); 762 } 748 const Platform::IntRectRegion renderedRegion = tileRegion(completedJobs, m_parent->frontState()); 763 749 764 750 m_regularRenderJobsNotRenderedRegion = Platform::IntRectRegion::unionRegions(m_regularRenderJobsNotRenderedRegion, regionNotRenderedThisTime); … … 812 798 #endif 813 799 814 bool shouldDirectRenderingToWindow = m_parent->shouldDirectRenderingToWindow();815 800 Platform::IntRect contentsRect = m_parent->expandedContentsRect(); 816 801 817 unsigned numberOfAvailableBackBuffers = shouldDirectRenderingToWindow 818 ? 0 819 : SurfacePool::globalSurfacePool()->numberOfAvailableBackBuffers(); 802 unsigned numberOfAvailableBackBuffers = SurfacePool::globalSurfacePool()->numberOfAvailableBackBuffers(); 820 803 821 804 // If we take multiple turns to render, we sort to make them appear in the right order. … … 881 864 if (!allAtOnceIfPossible) 882 865 break; // We can do the rest next time. 883 }884 885 if (shouldDirectRenderingToWindow) {886 // In direct rendering mode, any zoom or scroll job would require a887 // full-screen update.888 Platform::IntRect visibleContentsRect = m_parent->visibleContentsRect();889 Platform::IntRect renderedRect = m_parent->renderDirectToWindow(visibleContentsRect);890 if (!renderedRect.isEmpty())891 outstandingJobs->clear();892 866 } 893 867 -
trunk/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp
r142037 r142677 87 87 88 88 if (!m_numberOfFrontBuffers) 89 return; // we only use directrendering when 0 tiles are specified.89 return; // We completely disable tile rendering when 0 tiles are specified. 90 90 91 91 const unsigned numberOfBackBuffers = Platform::Settings::instance()->numberOfBackingStoreBackBuffers();
Note: See TracChangeset
for help on using the changeset viewer.