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

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

Powered by Google App Engine
This is Rietveld 408576698