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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2196583002: Paint local background colors onto foreground layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename PaintLayerPaintingBackgroundOntoForeground to PaintLayerPaintingRootBackgroundOntoForeground Created 4 years, 4 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 2445
2446 bool PaintLayer::shouldBeSelfPaintingLayer() const 2446 bool PaintLayer::shouldBeSelfPaintingLayer() const
2447 { 2447 {
2448 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing()) 2448 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing())
2449 return true; 2449 return true;
2450 return layoutObject()->layerTypeRequired() == NormalPaintLayer 2450 return layoutObject()->layerTypeRequired() == NormalPaintLayer
2451 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) 2451 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars())
2452 || needsCompositedScrolling(); 2452 || needsCompositedScrolling();
2453 } 2453 }
2454 2454
2455 bool PaintLayer::shouldPaintBackgroundOntoForeground() const
2456 {
2457 // TODO(flackr): Add support for painting locally attached background images . https://crbug.com/625882
2458 const FillLayer& backgroundLayer = layoutObject()->style()->backgroundLayers ();
2459 return !isRootLayer()
2460 && scrollsOverflow()
2461 && !backgroundLayer.image()
2462 && !backgroundLayer.next()
2463 && (backgroundLayer.attachment() == LocalBackgroundAttachment
2464 || backgroundLayer.clip() == PaddingFillBox)
2465 && !stackingNode()->hasNegativeZOrderList();
2466 }
2467
2455 void PaintLayer::updateSelfPaintingLayer() 2468 void PaintLayer::updateSelfPaintingLayer()
2456 { 2469 {
2457 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); 2470 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer();
2458 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) 2471 if (this->isSelfPaintingLayer() == isSelfPaintingLayer)
2459 return; 2472 return;
2460 2473
2461 m_isSelfPaintingLayer = isSelfPaintingLayer; 2474 m_isSelfPaintingLayer = isSelfPaintingLayer;
2462 2475
2463 if (PaintLayer* parent = this->parent()) { 2476 if (PaintLayer* parent = this->parent()) {
2464 parent->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 2477 parent->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 2937
2925 void showLayerTree(const blink::LayoutObject* layoutObject) 2938 void showLayerTree(const blink::LayoutObject* layoutObject)
2926 { 2939 {
2927 if (!layoutObject) { 2940 if (!layoutObject) {
2928 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2941 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2929 return; 2942 return;
2930 } 2943 }
2931 showLayerTree(layoutObject->enclosingLayer()); 2944 showLayerTree(layoutObject->enclosingLayer());
2932 } 2945 }
2933 #endif 2946 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698