Changeset 64054 in webkit
- Timestamp:
- Jul 26, 2010 10:48:13 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64051 r64054 1 2010-07-26 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Composited layers don't scroll in WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=42771 7 8 Rename two methods on RenderLayerCompositor to make their use more clear, and call them 9 when the FrameView gets resized and scrolled. 10 11 * page/FrameView.h: 12 * page/FrameView.cpp: 13 (WebCore::FrameView::setFrameRect): override so we know when the size of the FrameView changes, so that the 14 RenderLayerCompositor can update its clipping layer. 15 (WebCore::FrameView::scrollPositionChanged): Call compositor()->frameViewDidScroll(). 16 17 * rendering/RenderLayerBacking.cpp: 18 (WebCore::RenderLayerBacking::updateAfterWidgetResize): updateContentLayerOffset() was renamed. 19 20 * rendering/RenderLayerCompositor.h: 21 * rendering/RenderLayerCompositor.cpp: 22 (WebCore::RenderLayerCompositor::frameViewDidChangeSize): Renamed from updateContentLayerOffset(). 23 (WebCore::RenderLayerCompositor::frameViewDidScroll): Renamed from updateContentLayerScrollPosition(). 24 (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingIFrame): Propagate compositing on Mac 25 for any FrameView that doesn't have a native widget, which is the case with WebKit2. 26 (WebCore::RenderLayerCompositor::requiresScrollLayer): New method to tell us whether we need to handle 27 scrolling (and clipping) ourselves. 28 (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): Do geometry flipping on the root platform 29 layer only if we're not doing our own scrolling, and use the new requiresScrollLayer() method. 30 (WebCore::RenderLayerCompositor::attachRootPlatformLayer): Send out the rootPlatformLayer(), 31 so that it returns the clipping layer if we have one. 32 1 33 2010-07-26 Tony Gentilcore <tonyg@chromium.org> 2 34 -
trunk/WebCore/page/FrameView.cpp
r63907 r64054 329 329 } 330 330 331 void FrameView::setFrameRect(const IntRect& newRect) 332 { 333 IntRect oldRect = frameRect(); 334 if (newRect == oldRect) 335 return; 336 337 ScrollView::setFrameRect(newRect); 338 339 #if USE(ACCELERATED_COMPOSITING) 340 if (RenderView* root = m_frame->contentRenderer()) { 341 if (root->usesCompositing()) 342 root->compositor()->frameViewDidChangeSize(); 343 } 344 #endif 345 } 346 331 347 void FrameView::setMarginWidth(int w) 332 348 { … … 1116 1132 if (RenderView* root = m_frame->contentRenderer()) { 1117 1133 if (root->usesCompositing()) 1118 root->compositor()-> updateContentLayerScrollPosition(scrollPosition());1134 root->compositor()->frameViewDidScroll(scrollPosition()); 1119 1135 } 1120 1136 #endif -
trunk/WebCore/page/FrameView.h
r63907 r64054 64 64 65 65 virtual void invalidateRect(const IntRect&); 66 virtual void setFrameRect(const IntRect&); 66 67 67 68 Frame* frame() const { return m_frame.get(); } -
trunk/WebCore/rendering/RenderLayerBacking.cpp
r63820 r64054 212 212 if (renderer()->isRenderIFrame()) { 213 213 if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer()))) 214 innerCompositor-> updateContentLayerOffset(contentsBox().location());214 innerCompositor->frameViewDidChangeSize(contentsBox().location()); 215 215 } 216 216 } -
trunk/WebCore/rendering/RenderLayerCompositor.cpp
r63576 r64054 784 784 } 785 785 786 void RenderLayerCompositor:: updateContentLayerOffset(const IntPoint& contentsOffset)786 void RenderLayerCompositor::frameViewDidChangeSize(const IntPoint& contentsOffset) 787 787 { 788 788 if (m_clipLayer) { … … 796 796 } 797 797 798 void RenderLayerCompositor:: updateContentLayerScrollPosition(const IntPoint& scrollPosition)798 void RenderLayerCompositor::frameViewDidScroll(const IntPoint& scrollPosition) 799 799 { 800 800 if (m_scrollLayer) … … 1040 1040 return true; 1041 1041 #else 1042 // If we're viewless (i.e. WebKit2), we always propagate compositing. 1043 if (!m_renderView->frameView()->platformWidget()) 1044 return true; 1045 1042 1046 // On Mac, only propagate compositing if the iframe is overlapped in the parent 1043 1047 // document, or the parent is already compositing. … … 1260 1264 } 1261 1265 1266 bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const 1267 { 1268 if (attachment == RootLayerAttachedViaEnclosingIframe) 1269 return true; 1270 1271 #if PLATFORM(MAC) 1272 // If we're viewless (i.e. WebKit2), we need to scroll ourselves. 1273 // FIXME: eventually we should do this on other platforms too. 1274 if (!m_renderView->frameView()->platformWidget()) 1275 return true; 1276 #endif 1277 return false; 1278 } 1279 1262 1280 void RenderLayerCompositor::ensureRootPlatformLayer() 1263 1281 { … … 1278 1296 } 1279 1297 1280 // The root layer does flipping if we need it on this platform. 1281 m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation()); 1282 1283 if (expectedAttachment == RootLayerAttachedViaEnclosingIframe) { 1298 if (requiresScrollLayer(expectedAttachment)) { 1284 1299 if (!m_clipLayer) { 1285 1300 ASSERT(!m_scrollLayer); … … 1299 1314 m_scrollLayer->addChild(m_rootPlatformLayer.get()); 1300 1315 1301 updateContentLayerScrollPosition(m_renderView->frameView()->scrollPosition()); 1302 } 1303 } else if (m_clipLayer) { 1304 m_clipLayer->removeAllChildren(); 1305 m_clipLayer->removeFromParent(); 1306 m_clipLayer = 0; 1307 1308 m_scrollLayer->removeAllChildren(); 1309 m_scrollLayer = 0; 1316 frameViewDidChangeSize(); 1317 frameViewDidScroll(m_renderView->frameView()->scrollPosition()); 1318 } 1319 } else { 1320 if (m_clipLayer) { 1321 m_clipLayer->removeAllChildren(); 1322 m_clipLayer->removeFromParent(); 1323 m_clipLayer = 0; 1324 1325 m_scrollLayer->removeAllChildren(); 1326 m_scrollLayer = 0; 1327 } 1328 1329 // The root layer does geometry flipping if we need it. 1330 m_rootPlatformLayer->setGeometryOrientation(expectedAttachment == RootLayerAttachedViaEnclosingIframe 1331 ? GraphicsLayer::CompositingCoordinatesTopDown : GraphicsLayer::compositingCoordinatesOrientation()); 1310 1332 } 1311 1333 … … 1349 1371 return; 1350 1372 1351 page->chrome()->client()->attachRootGraphicsLayer(frame, m_rootPlatformLayer.get());1373 page->chrome()->client()->attachRootGraphicsLayer(frame, rootPlatformLayer()); 1352 1374 break; 1353 1375 } -
trunk/WebCore/rendering/RenderLayerCompositor.h
r63149 r64054 159 159 160 160 // Update the geometry of the layers used for clipping and scrolling in frames. 161 void updateContentLayerOffset(const IntPoint& contentsOffset);162 void updateContentLayerScrollPosition(const IntPoint&);161 void frameViewDidChangeSize(const IntPoint& contentsOffset = IntPoint()); 162 void frameViewDidScroll(const IntPoint& = IntPoint()); 163 163 164 164 private: … … 215 215 bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const; 216 216 217 bool requiresScrollLayer(RootLayerAttachment) const; 218 217 219 private: 218 220 RenderView* m_renderView; -
trunk/WebKit2/ChangeLog
r64050 r64054 1 2010-07-26 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Composited layers don't scroll in WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=42771 7 8 In WebKit2, do the compositing layer geometry flipping on the drawing area's main 9 backing layer. This both avoids us having to flip the layer contents, and also avoids issues 10 with the positioning of the root platform layer, which we want top-left. Doing the flipping 11 lower down would require that the root platform layer know where the scrollbar is. 12 13 * WebProcess/WebPage/LayerBackedDrawingArea.cpp: 14 (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea): 15 1 16 2010-07-26 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp
r63843 r64054 55 55 #endif 56 56 m_backingLayer->syncCompositingStateForThisLayerOnly(); 57 m_backingLayer->setContentsOrientation(GraphicsLayer::CompositingCoordinatesBottomUp); 57 58 // Do geometry flipping on this layer. 59 m_backingLayer->setGeometryOrientation(GraphicsLayer::CompositingCoordinatesBottomUp); 58 60 59 61 platformInit();
Note: See TracChangeset
for help on using the changeset viewer.