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

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

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments addressed and test baselines. Created 4 years, 3 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); 291 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants();
292 292
293 // non stacking context layers should never isolate 293 // non stacking context layers should never isolate
294 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); 294 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate);
295 295
296 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); 296 m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
297 } 297 }
298 298
299 void CompositedLayerMapping::updateBackgroundPaintsOntoScrollingContentsLayer() 299 void CompositedLayerMapping::updateBackgroundPaintsOntoScrollingContentsLayer()
300 { 300 {
301 bool shouldPaintOntoScrollingContentsLayer = shouldPaintBackgroundOntoScroll ingContentsLayer(); 301 bool shouldPaintOntoScrollingContentsLayer = m_owningLayer.shouldPaintBackgr oundOntoScrollingContentsLayer();
302 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo ntentsLayer()) { 302 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo ntentsLayer()) {
303 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC ontentsLayer; 303 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC ontentsLayer;
304 // If the background is no longer painted onto the scrolling contents 304 // If the background is no longer painted onto the scrolling contents
305 // layer the scrolling contents layer needs to be updated. If it is 305 // layer the scrolling contents layer needs to be updated. If it is
306 // going to be painted onto the scrolling contents layer this update 306 // going to be painted onto the scrolling contents layer this update
307 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali dationInRect 307 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali dationInRect
308 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer) 308 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer)
309 m_scrollingContentsLayer->setNeedsDisplay(); 309 m_scrollingContentsLayer->setNeedsDisplay();
310 } 310 }
311 } 311 }
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 if (m_squashedLayers[previousIndex].paintLayer == layerToRemove) 2576 if (m_squashedLayers[previousIndex].paintLayer == layerToRemove)
2577 break; 2577 break;
2578 } 2578 }
2579 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this ) { 2579 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this ) {
2580 compositor()->paintInvalidationOnCompositingChange(layerToRemove); 2580 compositor()->paintInvalidationOnCompositingChange(layerToRemove);
2581 return true; 2581 return true;
2582 } 2582 }
2583 return false; 2583 return false;
2584 } 2584 }
2585 2585
2586 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c onst
2587 {
2588 return !m_owningLayer.isRootLayer()
2589 && m_owningLayer.scrollsOverflow()
2590 && m_owningLayer.layoutObject()->style()->hasEntirelyLocalBackground()
2591 && !m_owningLayer.stackingNode()->hasNegativeZOrderList();
2592 }
2593
2594 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed Layer, size_t nextSquashedLayerIndex) 2586 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed Layer, size_t nextSquashedLayerIndex)
2595 { 2587 {
2596 GraphicsLayerPaintInfo paintInfo; 2588 GraphicsLayerPaintInfo paintInfo;
2597 paintInfo.paintLayer = squashedLayer; 2589 paintInfo.paintLayer = squashedLayer;
2598 // NOTE: composited bounds are updated elsewhere 2590 // NOTE: composited bounds are updated elsewhere
2599 // NOTE: offsetFromLayoutObject is updated elsewhere 2591 // NOTE: offsetFromLayoutObject is updated elsewhere
2600 2592
2601 // Change tracking on squashing layers: at the first sign of something chang ed, just invalidate the layer. 2593 // Change tracking on squashing layers: at the first sign of something chang ed, just invalidate the layer.
2602 // FIXME: Perhaps we can find a tighter more clever mechanism later. 2594 // FIXME: Perhaps we can find a tighter more clever mechanism later.
2603 if (nextSquashedLayerIndex < m_squashedLayers.size()) { 2595 if (nextSquashedLayerIndex < m_squashedLayers.size()) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2696 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2705 name = "Scrolling Contents Layer"; 2697 name = "Scrolling Contents Layer";
2706 } else { 2698 } else {
2707 ASSERT_NOT_REACHED(); 2699 ASSERT_NOT_REACHED();
2708 } 2700 }
2709 2701
2710 return name; 2702 return name;
2711 } 2703 }
2712 2704
2713 } // namespace blink 2705 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698