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

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

Powered by Google App Engine
This is Rietveld 408576698