Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 949303002: Fix invalidation during painting of scrollbars (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TestExpectations Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 updateMaskLayerGeometry(); 710 updateMaskLayerGeometry();
711 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi tingBounds); 711 updateTransformGeometry(snappedOffsetFromCompositedAncestor, relativeComposi tingBounds);
712 updateForegroundLayerGeometry(contentsSize, clippingBox); 712 updateForegroundLayerGeometry(contentsSize, clippingBox);
713 updateBackgroundLayerGeometry(contentsSize); 713 updateBackgroundLayerGeometry(contentsSize);
714 updateReflectionLayerGeometry(layersNeedingPaintInvalidation); 714 updateReflectionLayerGeometry(layersNeedingPaintInvalidation);
715 updateScrollingLayerGeometry(localCompositingBounds); 715 updateScrollingLayerGeometry(localCompositingBounds);
716 updateChildClippingMaskLayerGeometry(); 716 updateChildClippingMaskLayerGeometry();
717 717
718 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll sOverflow()) 718 if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scroll sOverflow())
719 m_owningLayer.scrollableArea()->positionOverflowControls(IntSize()); 719 m_owningLayer.scrollableArea()->positionOverflowControls();
720 720
721 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { 721 if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
722 updateLayerBlendMode(renderer()->styleRef()); 722 updateLayerBlendMode(renderer()->styleRef());
723 updateIsRootForIsolatedGroup(); 723 updateIsRootForIsolatedGroup();
724 } 724 }
725 725
726 updateContentsRect(); 726 updateContentsRect();
727 updateBackgroundColor(); 727 updateBackgroundColor();
728 updateDrawsContent(); 728 updateDrawsContent();
729 updateContentsOpaque(); 729 updateContentsOpaque();
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) { 1315 if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLay er(m_owningLayer)) {
1316 if (horizontalScrollbarLayerChanged) 1316 if (horizontalScrollbarLayerChanged)
1317 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), HorizontalScrollbar); 1317 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), HorizontalScrollbar);
1318 if (verticalScrollbarLayerChanged) 1318 if (verticalScrollbarLayerChanged)
1319 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), VerticalScrollbar); 1319 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_owning Layer.scrollableArea(), VerticalScrollbar);
1320 } 1320 }
1321 1321
1322 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s crollCornerLayerChanged; 1322 return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || s crollCornerLayerChanged;
1323 } 1323 }
1324 1324
1325 void CompositedLayerMapping::positionOverflowControlsLayers(const IntSize& offse tFromRoot) 1325 void CompositedLayerMapping::positionOverflowControlsLayers()
1326 { 1326 {
1327 IntSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer() - rounded IntSize(m_owningLayer.subpixelAccumulation()); 1327 IntSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer() - rounded IntSize(m_owningLayer.subpixelAccumulation());
1328 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) { 1328 if (GraphicsLayer* layer = layerForHorizontalScrollbar()) {
1329 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar(); 1329 Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar();
1330 if (hBar) { 1330 if (hBar) {
1331 layer->setPosition(hBar->frameRect().location() - offsetFromRoot - o ffsetFromRenderer); 1331 layer->setPosition(hBar->frameRect().location() - offsetFromRenderer );
1332 layer->setSize(hBar->frameRect().size()); 1332 layer->setSize(hBar->frameRect().size());
1333 if (layer->hasContentsLayer()) 1333 if (layer->hasContentsLayer())
1334 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz e())); 1334 layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().siz e()));
1335 } 1335 }
1336 layer->setDrawsContent(hBar && !layer->hasContentsLayer()); 1336 layer->setDrawsContent(hBar && !layer->hasContentsLayer());
1337 } 1337 }
1338 1338
1339 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { 1339 if (GraphicsLayer* layer = layerForVerticalScrollbar()) {
1340 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar(); 1340 Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar();
1341 if (vBar) { 1341 if (vBar) {
1342 layer->setPosition(vBar->frameRect().location() - offsetFromRoot - o ffsetFromRenderer); 1342 layer->setPosition(vBar->frameRect().location() - offsetFromRenderer );
1343 layer->setSize(vBar->frameRect().size()); 1343 layer->setSize(vBar->frameRect().size());
1344 if (layer->hasContentsLayer()) 1344 if (layer->hasContentsLayer())
1345 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz e())); 1345 layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().siz e()));
1346 } 1346 }
1347 layer->setDrawsContent(vBar && !layer->hasContentsLayer()); 1347 layer->setDrawsContent(vBar && !layer->hasContentsLayer());
1348 } 1348 }
1349 1349
1350 if (GraphicsLayer* layer = layerForScrollCorner()) { 1350 if (GraphicsLayer* layer = layerForScrollCorner()) {
1351 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollableArea( )->scrollCornerAndResizerRect(); 1351 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollableArea( )->scrollCornerAndResizerRect();
1352 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset FromRenderer)); 1352 layer->setPosition(FloatPoint(scrollCornerAndResizer.location() - offset FromRenderer));
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 } 2156 }
2157 } 2157 }
2158 } 2158 }
2159 } 2159 }
2160 2160
2161 static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRect& clip) 2161 static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRect& clip)
2162 { 2162 {
2163 if (!scrollbar) 2163 if (!scrollbar)
2164 return; 2164 return;
2165 2165
2166 context.save();
2167 const IntRect& scrollbarRect = scrollbar->frameRect(); 2166 const IntRect& scrollbarRect = scrollbar->frameRect();
2168 context.translate(-scrollbarRect.x(), -scrollbarRect.y()); 2167 TransformRecorder transformRecorder(context, scrollbar->displayItemClient(), AffineTransform::translation(-scrollbarRect.x(), -scrollbarRect.y()));
2169 IntRect transformedClip = clip; 2168 IntRect transformedClip = clip;
2170 transformedClip.moveBy(scrollbarRect.location()); 2169 transformedClip.moveBy(scrollbarRect.location());
2171 scrollbar->paint(&context, transformedClip); 2170 scrollbar->paint(&context, transformedClip);
2172 context.restore();
2173 } 2171 }
2174 2172
2175 // Up-call from compositing layer drawing callback. 2173 // Up-call from compositing layer drawing callback.
2176 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect& clip) 2174 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect& clip)
2177 { 2175 {
2178 // https://code.google.com/p/chromium/issues/detail?id=343772 2176 // https://code.google.com/p/chromium/issues/detail?id=343772
2179 DisableCompositingQueryAsserts disabler; 2177 DisableCompositingQueryAsserts disabler;
2180 #if ENABLE(ASSERT) 2178 #if ENABLE(ASSERT)
2181 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead. 2179 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead.
2182 if (Page* page = renderer()->frame()->page()) 2180 if (Page* page = renderer()->frame()->page())
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2354 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2357 name = "Scrolling Block Selection Layer"; 2355 name = "Scrolling Block Selection Layer";
2358 } else { 2356 } else {
2359 ASSERT_NOT_REACHED(); 2357 ASSERT_NOT_REACHED();
2360 } 2358 }
2361 2359
2362 return name; 2360 return name;
2363 } 2361 }
2364 2362
2365 } // namespace blink 2363 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698