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

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

Issue 2346883003: Only paint the background onto the scrolling contents layer if we have a scrolling contents layer. (Closed)
Patch Set: Remove obsolete border-radius test. 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 = m_owningLayer.shouldPaintBackgr oundOntoScrollingContentsLayer(); 302 bool shouldPaintOntoScrollingContentsLayer =
303 m_owningLayer.canPaintBackgroundOntoScrollingContentsLayer()
304 && m_owningLayer.needsCompositedScrolling();
Stephen Chennney 2016/09/15 20:08:37 Indent. And add a comment here about why composit
flackr 2016/09/15 20:28:37 I'm confused, isn't that the correct indent for tw
303 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo ntentsLayer()) { 305 if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingCo ntentsLayer()) {
304 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC ontentsLayer; 306 m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingC ontentsLayer;
305 // If the background is no longer painted onto the scrolling contents 307 // If the background is no longer painted onto the scrolling contents
306 // layer the scrolling contents layer needs to be updated. If it is 308 // layer the scrolling contents layer needs to be updated. If it is
307 // going to be painted onto the scrolling contents layer this update 309 // going to be painted onto the scrolling contents layer this update
308 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali dationInRect 310 // will be triggered by LayoutBoxModelObject::setBackingNeedsPaintInvali dationInRect
309 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer) 311 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer)
310 m_scrollingContentsLayer->setNeedsDisplay(); 312 m_scrollingContentsLayer->setNeedsDisplay();
311 } 313 }
312 } 314 }
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2699 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2698 name = "Scrolling Contents Layer"; 2700 name = "Scrolling Contents Layer";
2699 } else { 2701 } else {
2700 ASSERT_NOT_REACHED(); 2702 ASSERT_NOT_REACHED();
2701 } 2703 }
2702 2704
2703 return name; 2705 return name;
2704 } 2706 }
2705 2707
2706 } // namespace blink 2708 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698