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

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

Issue 2025093002: Refactor to simplify how layerType is stored on PaintLayers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 , compositingReasons(CompositingReasonNone) 127 , compositingReasons(CompositingReasonNone)
128 , squashingDisallowedReasons(SquashingDisallowedReasonsNone) 128 , squashingDisallowedReasons(SquashingDisallowedReasonsNone)
129 , groupedMapping(nullptr) 129 , groupedMapping(nullptr)
130 { 130 {
131 } 131 }
132 132
133 PaintLayerRareData::~PaintLayerRareData() 133 PaintLayerRareData::~PaintLayerRareData()
134 { 134 {
135 } 135 }
136 136
137 PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject, PaintLayerType type) 137 PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject)
138 : m_layerType(type) 138 : m_hasSelfPaintingLayerDescendant(false)
139 , m_hasSelfPaintingLayerDescendant(false)
140 , m_hasSelfPaintingLayerDescendantDirty(false) 139 , m_hasSelfPaintingLayerDescendantDirty(false)
141 , m_isRootLayer(layoutObject->isLayoutView()) 140 , m_isRootLayer(layoutObject->isLayoutView())
142 , m_visibleContentStatusDirty(true) 141 , m_visibleContentStatusDirty(true)
143 , m_hasVisibleContent(false) 142 , m_hasVisibleContent(false)
144 , m_visibleDescendantStatusDirty(false) 143 , m_visibleDescendantStatusDirty(false)
145 , m_hasVisibleDescendant(false) 144 , m_hasVisibleDescendant(false)
146 , m_hasVisibleNonLayerContent(false) 145 , m_hasVisibleNonLayerContent(false)
147 #if ENABLE(ASSERT) 146 #if ENABLE(ASSERT)
148 , m_needsPositionUpdate(true) 147 , m_needsPositionUpdate(true)
149 #endif 148 #endif
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) 2444 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect))
2446 return true; 2445 return true;
2447 } 2446 }
2448 return false; 2447 return false;
2449 } 2448 }
2450 2449
2451 bool PaintLayer::shouldBeSelfPaintingLayer() const 2450 bool PaintLayer::shouldBeSelfPaintingLayer() const
2452 { 2451 {
2453 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing()) 2452 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires AcceleratedCompositing())
2454 return true; 2453 return true;
2455 return m_layerType == NormalPaintLayer 2454 return layoutObject()->layerTypeRequired() == NormalPaintLayer
2456 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) 2455 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars())
2457 || needsCompositedScrolling(); 2456 || needsCompositedScrolling();
2458 } 2457 }
2459 2458
2460 void PaintLayer::updateSelfPaintingLayer() 2459 void PaintLayer::updateSelfPaintingLayer()
2461 { 2460 {
2462 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); 2461 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer();
2463 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) 2462 if (this->isSelfPaintingLayer() == isSelfPaintingLayer)
2464 return; 2463 return;
2465 2464
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2912 2911
2913 void showLayerTree(const blink::LayoutObject* layoutObject) 2912 void showLayerTree(const blink::LayoutObject* layoutObject)
2914 { 2913 {
2915 if (!layoutObject) { 2914 if (!layoutObject) {
2916 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2915 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2917 return; 2916 return;
2918 } 2917 }
2919 showLayerTree(layoutObject->enclosingLayer()); 2918 showLayerTree(layoutObject->enclosingLayer());
2920 } 2919 }
2921 #endif 2920 #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