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

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

Issue 1841673003: Store PaintLayerFilterInfo in PaintLayerRareData instead of a HashMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 , m_hasVisibleContent(false) 142 , m_hasVisibleContent(false)
143 , m_visibleDescendantStatusDirty(false) 143 , m_visibleDescendantStatusDirty(false)
144 , m_hasVisibleDescendant(false) 144 , m_hasVisibleDescendant(false)
145 , m_hasVisibleNonLayerContent(false) 145 , m_hasVisibleNonLayerContent(false)
146 #if ENABLE(ASSERT) 146 #if ENABLE(ASSERT)
147 , m_needsPositionUpdate(true) 147 , m_needsPositionUpdate(true)
148 #endif 148 #endif
149 , m_3DTransformedDescendantStatusDirty(true) 149 , m_3DTransformedDescendantStatusDirty(true)
150 , m_has3DTransformedDescendant(false) 150 , m_has3DTransformedDescendant(false)
151 , m_containsDirtyOverlayScrollbars(false) 151 , m_containsDirtyOverlayScrollbars(false)
152 , m_hasFilterInfo(false)
153 , m_needsAncestorDependentCompositingInputsUpdate(true) 152 , m_needsAncestorDependentCompositingInputsUpdate(true)
154 , m_needsDescendantDependentCompositingInputsUpdate(true) 153 , m_needsDescendantDependentCompositingInputsUpdate(true)
155 , m_childNeedsCompositingInputsUpdate(true) 154 , m_childNeedsCompositingInputsUpdate(true)
156 , m_hasCompositingDescendant(false) 155 , m_hasCompositingDescendant(false)
157 , m_hasNonCompositedChild(false) 156 , m_hasNonCompositedChild(false)
158 , m_shouldIsolateCompositedDescendants(false) 157 , m_shouldIsolateCompositedDescendants(false)
159 , m_lostGroupedMapping(false) 158 , m_lostGroupedMapping(false)
160 , m_needsRepaint(false) 159 , m_needsRepaint(false)
161 , m_previousPaintResult(PaintLayerPainter::FullyPainted) 160 , m_previousPaintResult(PaintLayerPainter::FullyPainted)
162 , m_needsPaintPhaseDescendantOutlines(false) 161 , m_needsPaintPhaseDescendantOutlines(false)
(...skipping 23 matching lines...) Expand all
186 updateScrollableArea(); 185 updateScrollableArea();
187 } 186 }
188 187
189 PaintLayer::~PaintLayer() 188 PaintLayer::~PaintLayer()
190 { 189 {
191 if (layoutObject()->frame() && layoutObject()->frame()->page()) { 190 if (layoutObject()->frame() && layoutObject()->frame()->page()) {
192 if (ScrollingCoordinator* scrollingCoordinator = layoutObject()->frame() ->page()->scrollingCoordinator()) 191 if (ScrollingCoordinator* scrollingCoordinator = layoutObject()->frame() ->page()->scrollingCoordinator())
193 scrollingCoordinator->willDestroyLayer(this); 192 scrollingCoordinator->willDestroyLayer(this);
194 } 193 }
195 194
196 removeFilterInfoIfNeeded();
197
198 if (groupedMapping()) { 195 if (groupedMapping()) {
199 DisableCompositingQueryAsserts disabler; 196 DisableCompositingQueryAsserts disabler;
200 setGroupedMapping(0, InvalidateLayerAndRemoveFromMapping); 197 setGroupedMapping(0, InvalidateLayerAndRemoveFromMapping);
201 } 198 }
202 199
203 // Child layers will be deleted by their corresponding layout objects, so 200 // Child layers will be deleted by their corresponding layout objects, so
204 // we don't need to delete them ourselves. 201 // we don't need to delete them ourselves.
205 202
206 clearCompositedLayerMapping(true); 203 clearCompositedLayerMapping(true);
207 204
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2607 FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style) const 2604 FilterOperations PaintLayer::computeFilterOperations(const ComputedStyle& style) const
2608 { 2605 {
2609 return computeFilterOperationsHandleReferenceFilters(style.filter(), style.e ffectiveZoom(), enclosingNode()); 2606 return computeFilterOperationsHandleReferenceFilters(style.filter(), style.e ffectiveZoom(), enclosingNode());
2610 } 2607 }
2611 2608
2612 FilterOperations PaintLayer::computeBackdropFilterOperations(const ComputedStyle & style) const 2609 FilterOperations PaintLayer::computeBackdropFilterOperations(const ComputedStyle & style) const
2613 { 2610 {
2614 return computeFilterOperationsHandleReferenceFilters(style.backdropFilter(), style.effectiveZoom(), enclosingNode()); 2611 return computeFilterOperationsHandleReferenceFilters(style.backdropFilter(), style.effectiveZoom(), enclosingNode());
2615 } 2612 }
2616 2613
2614 PaintLayerFilterInfo& PaintLayer::ensureFilterInfo()
2615 {
2616 PaintLayerRareData& rareData = ensureRareData();
2617 if (!rareData.filterInfo)
2618 rareData.filterInfo = adoptPtr(new PaintLayerFilterInfo(this));
2619 return *rareData.filterInfo;
2620 }
2621
2617 void PaintLayer::updateOrRemoveFilterClients() 2622 void PaintLayer::updateOrRemoveFilterClients()
2618 { 2623 {
2619 if (!hasFilter()) { 2624 if (!hasFilter() && m_rareData) {
2620 removeFilterInfoIfNeeded(); 2625 m_rareData->filterInfo = nullptr;
2621 return; 2626 } else if (layoutObject()->style()->filter().hasReferenceFilter()) {
2627 ensureFilterInfo().updateReferenceFilterClients(layoutObject()->style()- >filter());
2628 } else if (filterInfo()) {
2629 filterInfo()->clearFilterReferences();
2622 } 2630 }
2623
2624 if (layoutObject()->style()->filter().hasReferenceFilter())
2625 ensureFilterInfo()->updateReferenceFilterClients(layoutObject()->style() ->filter());
2626 else if (hasFilterInfo())
2627 filterInfo()->clearFilterReferences();
2628 } 2631 }
2629 2632
2630 FilterEffectBuilder* PaintLayer::updateFilterEffectBuilder() const 2633 FilterEffectBuilder* PaintLayer::updateFilterEffectBuilder() const
2631 { 2634 {
2632 // TODO(chrishtr): ensure (and assert) that compositing is clean here. 2635 // TODO(chrishtr): ensure (and assert) that compositing is clean here.
2633 2636
2634 if (!paintsWithFilters()) 2637 if (!paintsWithFilters())
2635 return nullptr; 2638 return nullptr;
2636 2639
2637 PaintLayerFilterInfo* filterInfo = this->filterInfo(); 2640 PaintLayerFilterInfo* filterInfo = this->filterInfo();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2676 // mode might have changed for this layer. 2679 // mode might have changed for this layer.
2677 if (!paintsWithFilters()) { 2680 if (!paintsWithFilters()) {
2678 // Don't delete the whole filter info here, because we might use it 2681 // Don't delete the whole filter info here, because we might use it
2679 // for loading CSS shader files. 2682 // for loading CSS shader files.
2680 if (PaintLayerFilterInfo* filterInfo = this->filterInfo()) 2683 if (PaintLayerFilterInfo* filterInfo = this->filterInfo())
2681 filterInfo->setBuilder(nullptr); 2684 filterInfo->setBuilder(nullptr);
2682 2685
2683 return; 2686 return;
2684 } 2687 }
2685 2688
2686 ensureFilterInfo()->setBuilder(nullptr); 2689 ensureFilterInfo().setBuilder(nullptr);
2687 } 2690 }
2688 2691
2689 void PaintLayer::filterNeedsPaintInvalidation() 2692 void PaintLayer::filterNeedsPaintInvalidation()
2690 { 2693 {
2691 { 2694 {
2692 DeprecatedScheduleStyleRecalcDuringLayout marker(layoutObject()->documen t().lifecycle()); 2695 DeprecatedScheduleStyleRecalcDuringLayout marker(layoutObject()->documen t().lifecycle());
2693 // It's possible for scheduleSVGFilterLayerUpdateHack to schedule a styl e recalc, which 2696 // It's possible for scheduleSVGFilterLayerUpdateHack to schedule a styl e recalc, which
2694 // is a problem because this function can be called right before perform ing layout but 2697 // is a problem because this function can be called right before perform ing layout but
2695 // after style recalc. 2698 // after style recalc.
2696 // 2699 //
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 2817
2815 void showLayerTree(const blink::LayoutObject* layoutObject) 2818 void showLayerTree(const blink::LayoutObject* layoutObject)
2816 { 2819 {
2817 if (!layoutObject) { 2820 if (!layoutObject) {
2818 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2821 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2819 return; 2822 return;
2820 } 2823 }
2821 showLayerTree(layoutObject->enclosingLayer()); 2824 showLayerTree(layoutObject->enclosingLayer());
2822 } 2825 }
2823 #endif 2826 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerFilterInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698