Changeset 142112 in webkit
- Timestamp:
- Feb 7, 2013 6:47:50 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r142105 r142112 1 2013-02-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers 4 https://bugs.webkit.org/show_bug.cgi?id=108990 5 6 Reviewed by Noam Rosenthal. 7 8 Add a new test that allow us to remove the fixed positioning of a layer but still keeping 9 it compositing. Coordinated Graphics had a bug where the CoordinatedSceneGraph would still 10 count this layer as fixed position. 11 12 * ManualTests/remove-fixed-position-but-keep-compositing.html: Added. 13 1 14 2013-02-07 Gustavo Noronha Silva <gns@gnome.org> 2 15 -
trunk/Source/WebCore/CMakeLists.txt
r142072 r142112 45 45 "${WEBCORE_DIR}/page/animation" 46 46 "${WEBCORE_DIR}/page/scrolling" 47 "${WEBCORE_DIR}/page/scrolling/coordinatedgraphics" 47 48 "${WEBCORE_DIR}/platform" 48 49 "${WEBCORE_DIR}/platform/animation" … … 1821 1822 page/scrolling/ScrollingConstraints.cpp 1822 1823 page/scrolling/ScrollingCoordinator.cpp 1824 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp 1823 1825 1824 1826 platform/Arena.cpp -
trunk/Source/WebCore/ChangeLog
r142111 r142112 1 2013-02-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers 4 https://bugs.webkit.org/show_bug.cgi?id=108990 5 6 Reviewed by Noam Rosenthal. 7 8 WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we 9 don't need to traverse the tree every frame to get this information. 10 11 The function ScrollingCoordinator::setLayerIsFixedToContainerLayer() is called when 12 RenderLayerBacking is updating its graphics layers. 13 14 The new code also works in new situations where the previous was broken: if a layer changed 15 from being fixed to not fixed (but still kept as a layer for other reasons), the layer will 16 be correctly updated. Previous implementation only had logic to mark layers as fixed, but 17 not the other way round. A manual test was added to illustrate the solved problem. 18 19 Testing was done with the existing manual tests that make use of "position:fixed". Automatic 20 tests are mostly not affected by this because usage of this information affects only the 21 UseFixedLayout mode, not used by default in WebKitTestRunner. Work to improve this situation 22 will be tracked in bug https://bugs.webkit.org/show_bug.cgi?id=109175. 23 24 * CMakeLists.txt: 25 * Target.pri: 26 * WebCore.pri: 27 * page/scrolling/ScrollingCoordinator.cpp: 28 (WebCore::ScrollingCoordinator::create): create specific version of ScrollingCoordinator. 29 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Added. 30 (WebCore): 31 (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): 32 (WebCore::ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer): 33 update layer information using existing hook in ScrollingCoordinator. 34 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added. 35 (WebCore): 36 (ScrollingCoordinatorCoordinatedGraphics): 37 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: 38 (WebCore::CoordinatedGraphicsLayer::setFixedToViewport): now that setting viewport is not 39 embedded in the synchronization work, we need to mark the layer so it is updated in the 40 next frame. 41 (WebCore): 42 (WebCore::CoordinatedGraphicsLayer::flushCompositingState): remove call to syncFixedLayers(). 43 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 44 (CoordinatedGraphicsLayerClient): remove now unused syncFixedLayers() from client. 45 (CoordinatedGraphicsLayer): 46 1 47 2013-02-07 Keishi Hattori <keishi@webkit.org> 2 48 -
trunk/Source/WebCore/Target.pri
r142072 r142112 4067 4067 use?(3D_GRAPHICS) { 4068 4068 HEADERS += \ 4069 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h \ 4069 4070 platform/graphics/cpu/arm/GraphicsContext3DNEON.h \ 4070 4071 platform/graphics/ANGLEWebKitBridge.h \ … … 4091 4092 4092 4093 SOURCES += \ 4094 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp \ 4093 4095 platform/graphics/ANGLEWebKitBridge.cpp \ 4094 4096 platform/graphics/GraphicsContext3D.cpp \ -
trunk/Source/WebCore/WebCore.pri
r140675 r142112 51 51 $$SOURCE_DIR/page/qt \ 52 52 $$SOURCE_DIR/page/scrolling \ 53 $$SOURCE_DIR/page/scrolling/coordinatedgraphics \ 53 54 $$SOURCE_DIR/platform \ 54 55 $$SOURCE_DIR/platform/animation \ … … 64 65 $$SOURCE_DIR/platform/graphics/surfaces \ 65 66 $$SOURCE_DIR/platform/graphics/texmap \ 67 $$SOURCE_DIR/platform/graphics/texmap/coordinated \ 66 68 $$SOURCE_DIR/platform/graphics/transforms \ 67 69 $$SOURCE_DIR/platform/image-decoders \ -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r140732 r142112 53 53 #endif 54 54 55 #if USE(COORDINATED_GRAPHICS) 56 #include "ScrollingCoordinatorCoordinatedGraphics.h" 57 #endif 58 55 59 namespace WebCore { 56 60 … … 63 67 #if PLATFORM(CHROMIUM) 64 68 return adoptRef(new ScrollingCoordinatorChromium(page)); 69 #endif 70 71 #if USE(COORDINATED_GRAPHICS) 72 return adoptRef(new ScrollingCoordinatorCoordinatedGraphics(page)); 65 73 #endif 66 74 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
r141543 r142112 465 465 } 466 466 467 void CoordinatedGraphicsLayer::setFixedToViewport(bool isFixed) 468 { 469 if (m_fixedToViewport == isFixed) 470 return; 471 472 m_fixedToViewport = isFixed; 473 didChangeLayerState(); 474 } 475 467 476 void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect) 468 477 { … … 478 487 if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer())) 479 488 replica->flushCompositingStateForThisLayerOnly(); 480 481 m_coordinator->syncFixedLayers();482 489 483 490 flushCompositingStateForThisLayerOnly(); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
r141543 r142112 73 73 74 74 virtual void detachLayer(CoordinatedGraphicsLayer*) = 0; 75 virtual void syncFixedLayers() = 0;76 75 virtual PassOwnPtr<GraphicsContext> beginContentUpdate(const IntSize&, CoordinatedSurface::Flags, uint32_t& atlasID, IntPoint&) = 0; 77 76 }; … … 138 137 CoordinatedLayerID id() const; 139 138 140 void setFixedToViewport(bool isFixed) { m_fixedToViewport = isFixed; }139 void setFixedToViewport(bool isFixed); 141 140 142 141 IntRect coverRect() const { return m_mainBackingStore ? m_mainBackingStore->mapToContents(m_mainBackingStore->coverRect()) : IntRect(); } -
trunk/Source/WebKit2/ChangeLog
r142095 r142112 1 2013-02-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 [CoordinatedGraphics] Use ScrollingCoordinator to track fixed layers 4 https://bugs.webkit.org/show_bug.cgi?id=108990 5 6 Reviewed by Noam Rosenthal. 7 Signed off for WebKit2 by Simon Fraser. 8 9 WebCore keeps ScrollingCoordinator up-to-date about whether layers are fixed or not, so we 10 don't need to traverse the tree every frame to get this information. 11 12 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: remove 13 syncFixedLayers() and its helper functions. Those were used to identify the fixed layers 14 and are not needed anymore. 15 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 16 * WebProcess/WebPage/DrawingAreaImpl.cpp: 17 (WebKit::DrawingAreaImpl::DrawingAreaImpl): enable the scrolling coordinator usage for 18 Coordinated Graphics. 19 1 20 2013-02-07 Michael Brüning <michael.bruning@digia.com> 2 21 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
r141853 r142112 470 470 } 471 471 472 static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer)473 {474 // These conditions must match the conditions in RenderLayerCompositor::requiresCompositingForPosition.475 RenderLayerBacking* backing = renderLayer->backing();476 if (!backing)477 return;478 479 RenderStyle* style = renderLayer->renderer()->style();480 if (!style)481 return;482 483 if (!renderLayer->renderer()->isOutOfFlowPositioned() || renderLayer->renderer()->style()->position() != FixedPosition)484 return;485 486 if (!renderLayer->renderer()->container()->isRenderView())487 return;488 489 if (!renderLayer->isStackingContainer())490 return;491 492 CoordinatedGraphicsLayer* graphicsLayer = toCoordinatedGraphicsLayer(backing->graphicsLayer());493 graphicsLayer->setFixedToViewport(true);494 }495 496 static void updateOffsetFromViewportForLayer(RenderLayer* renderLayer)497 {498 updateOffsetFromViewportForSelf(renderLayer);499 500 if (renderLayer->firstChild())501 updateOffsetFromViewportForLayer(renderLayer->firstChild());502 if (renderLayer->nextSibling())503 updateOffsetFromViewportForLayer(renderLayer->nextSibling());504 }505 506 void CoordinatedLayerTreeHost::syncFixedLayers()507 {508 if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled())509 return;510 511 if (!m_webPage->mainFrame()->view()->hasViewportConstrainedObjects())512 return;513 514 RenderLayer* rootRenderLayer = m_webPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer();515 ASSERT(rootRenderLayer);516 if (rootRenderLayer->firstChild())517 updateOffsetFromViewportForLayer(rootRenderLayer->firstChild());518 }519 520 472 void CoordinatedLayerTreeHost::lockAnimations() 521 473 { -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
r141543 r142112 106 106 virtual void setLayerRepaintCount(WebCore::CoordinatedLayerID, int) OVERRIDE; 107 107 virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*); 108 virtual void syncFixedLayers();109 108 110 109 virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& atlasID, WebCore::IntPoint&); -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r141366 r142112 74 74 #if USE(COORDINATED_GRAPHICS) 75 75 m_alwaysUseCompositing = true; 76 webPage->corePage()->settings()->setScrollingCoordinatorEnabled(true); 76 77 #endif 77 78
Note: See TracChangeset
for help on using the changeset viewer.