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

Side by Side Diff: sky/engine/core/rendering/RenderLayerRepainter.cpp

Issue 840403003: First pass at deleting paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 m_renderer.setPreviousPaintInvalidationRect(m_renderer.boundsRectForPaintInv alidation(m_renderer.containerForPaintInvalidation())); 63 m_renderer.setPreviousPaintInvalidationRect(m_renderer.boundsRectForPaintInv alidation(m_renderer.containerForPaintInvalidation()));
64 // FIXME: We are only updating the paint invalidation bounds but not 64 // FIXME: We are only updating the paint invalidation bounds but not
65 // the positionFromPaintInvalidationContainer. This means that we may 65 // the positionFromPaintInvalidationContainer. This means that we may
66 // forcing a full invaliation of the new position. Is this really correct? 66 // forcing a full invaliation of the new position. Is this really correct?
67 67
68 for (RenderLayer* layer = m_renderer.layer()->firstChild(); layer; layer = l ayer->nextSibling()) { 68 for (RenderLayer* layer = m_renderer.layer()->firstChild(); layer; layer = l ayer->nextSibling()) {
69 layer->paintInvalidator().computePaintInvalidationRectsIncludingNonCompo sitingDescendants(); 69 layer->paintInvalidator().computePaintInvalidationRectsIncludingNonCompo sitingDescendants();
70 } 70 }
71 } 71 }
72 72
73 // Since we're only painting non-composited layers, we know that they all share the same paintInvalidationContainer.
74 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendants()
75 {
76 paintInvalidationIncludingNonCompositingDescendantsInternal(m_renderer.conta inerForPaintInvalidation());
77 }
78
79 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendantsIn ternal(const RenderLayerModelObject* paintInvalidationContainer)
80 {
81 m_renderer.invalidatePaintUsingContainer(paintInvalidationContainer, m_rende rer.previousPaintInvalidationRect(), InvalidationLayer);
82
83 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr ->nextSibling()) {
84 curr->paintInvalidator().paintInvalidationIncludingNonCompositingDescend antsInternal(paintInvalidationContainer);
85 }
86 }
87
88 LayoutRect RenderLayerRepainter::paintInvalidationRectIncludingNonCompositingDes cendants() const
89 {
90 LayoutRect paintInvalidationRect = m_renderer.previousPaintInvalidationRect( );
91
92 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c hild->nextSibling()) {
93 paintInvalidationRect.unite(child->paintInvalidator().paintInvalidationR ectIncludingNonCompositingDescendants());
94 }
95 return paintInvalidationRect;
96 }
97
98 void RenderLayerRepainter::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r)
99 {
100 // FIXME(sky): Remove.
101 ASSERT_NOT_REACHED();
102 }
103
104 void RenderLayerRepainter::setFilterBackendNeedsPaintInvalidationInRect(const La youtRect& rect) 73 void RenderLayerRepainter::setFilterBackendNeedsPaintInvalidationInRect(const La youtRect& rect)
105 { 74 {
106 if (rect.isEmpty()) 75 if (rect.isEmpty())
107 return; 76 return;
108 LayoutRect rectForPaintInvalidation = rect; 77 LayoutRect rectForPaintInvalidation = rect;
109 78
110 ASSERT(m_renderer.layer()->filterInfo()); 79 ASSERT(m_renderer.layer()->filterInfo());
111 80
112 RenderLayer* parentLayer = enclosingFilterPaintInvalidationLayer(); 81 RenderLayer* parentLayer = enclosingFilterPaintInvalidationLayer();
113 ASSERT(parentLayer); 82 ASSERT(parentLayer);
(...skipping 20 matching lines...) Expand all
134 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const 103 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const
135 { 104 {
136 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) { 105 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) {
137 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->isRootLayer()) 106 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->isRootLayer())
138 return const_cast<RenderLayer*>(curr); 107 return const_cast<RenderLayer*>(curr);
139 } 108 }
140 return 0; 109 return 0;
141 } 110 }
142 111
143 } // namespace blink 112 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayerRepainter.h ('k') | sky/engine/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698