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

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

Issue 2002153007: Refactor to simplify how layerType is stored on PaintLayers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 , compositingReasons(CompositingReasonNone) 128 , compositingReasons(CompositingReasonNone)
129 , squashingDisallowedReasons(SquashingDisallowedReasonsNone) 129 , squashingDisallowedReasons(SquashingDisallowedReasonsNone)
130 , groupedMapping(nullptr) 130 , groupedMapping(nullptr)
131 { 131 {
132 } 132 }
133 133
134 PaintLayerRareData::~PaintLayerRareData() 134 PaintLayerRareData::~PaintLayerRareData()
135 { 135 {
136 } 136 }
137 137
138 PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject, PaintLayerType type) 138 PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject)
139 : m_layerType(type) 139 : m_hasSelfPaintingLayerDescendant(false)
140 , m_hasSelfPaintingLayerDescendant(false)
141 , m_hasSelfPaintingLayerDescendantDirty(false) 140 , m_hasSelfPaintingLayerDescendantDirty(false)
142 , m_isRootLayer(layoutObject->isLayoutView()) 141 , m_isRootLayer(layoutObject->isLayoutView())
143 , m_visibleContentStatusDirty(true) 142 , m_visibleContentStatusDirty(true)
144 , m_hasVisibleContent(false) 143 , m_hasVisibleContent(false)
145 , m_visibleDescendantStatusDirty(false) 144 , m_visibleDescendantStatusDirty(false)
146 , m_hasVisibleDescendant(false) 145 , m_hasVisibleDescendant(false)
147 , m_hasVisibleNonLayerContent(false) 146 , m_hasVisibleNonLayerContent(false)
148 #if ENABLE(ASSERT) 147 #if ENABLE(ASSERT)
149 , m_needsPositionUpdate(true) 148 , m_needsPositionUpdate(true)
150 #endif 149 #endif
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) 2445 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect))
2447 return true; 2446 return true;
2448 } 2447 }
2449 return false; 2448 return false;
2450 } 2449 }
2451 2450
2452 bool PaintLayer::shouldBeSelfPaintingLayer() const 2451 bool PaintLayer::shouldBeSelfPaintingLayer() const
2453 { 2452 {
2454 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing()) 2453 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing())
2455 return true; 2454 return true;
2456 return m_layerType == NormalPaintLayer 2455 return layoutObject()->layerTypeRequired() == NormalPaintLayer
2457 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) 2456 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars())
2458 || needsCompositedScrolling(); 2457 || needsCompositedScrolling();
2459 } 2458 }
2460 2459
2461 void PaintLayer::updateSelfPaintingLayer() 2460 void PaintLayer::updateSelfPaintingLayer()
2462 { 2461 {
2463 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); 2462 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer();
2464 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) 2463 if (this->isSelfPaintingLayer() == isSelfPaintingLayer)
2465 return; 2464 return;
2466 2465
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2913 2912
2914 void showLayerTree(const blink::LayoutObject* layoutObject) 2913 void showLayerTree(const blink::LayoutObject* layoutObject)
2915 { 2914 {
2916 if (!layoutObject) { 2915 if (!layoutObject) {
2917 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2916 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2918 return; 2917 return;
2919 } 2918 }
2920 showLayerTree(layoutObject->enclosingLayer()); 2919 showLayerTree(layoutObject->enclosingLayer());
2921 } 2920 }
2922 #endif 2921 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698