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

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

Issue 768493002: Get rid of CompositingState. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix incorrect case. Created 6 years 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 { 59 {
60 // FIXME: boundsRectForPaintInvalidation() has to walk up the parent chain 60 // FIXME: boundsRectForPaintInvalidation() has to walk up the parent chain
61 // for every layer to compute the rects. We should make this more efficient. 61 // for every layer to compute the rects. We should make this more efficient.
62 // FIXME: it's wrong to call this when layout is not up-to-date, which we do . 62 // FIXME: it's wrong to call this when layout is not up-to-date, which we do .
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 if (layer->compositingState() != PaintsIntoOwnBacking && layer->composit ingState() != PaintsIntoGroupedBacking) 69 layer->paintInvalidator().computePaintInvalidationRectsIncludingNonCompo sitingDescendants();
70 layer->paintInvalidator().computePaintInvalidationRectsIncludingNonC ompositingDescendants();
71 } 70 }
72 } 71 }
73 72
74 // Since we're only painting non-composited layers, we know that they all share the same paintInvalidationContainer. 73 // Since we're only painting non-composited layers, we know that they all share the same paintInvalidationContainer.
75 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendants() 74 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendants()
76 { 75 {
77 paintInvalidationIncludingNonCompositingDescendantsInternal(m_renderer.conta inerForPaintInvalidation()); 76 paintInvalidationIncludingNonCompositingDescendantsInternal(m_renderer.conta inerForPaintInvalidation());
78 } 77 }
79 78
80 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendantsIn ternal(const RenderLayerModelObject* paintInvalidationContainer) 79 void RenderLayerRepainter::paintInvalidationIncludingNonCompositingDescendantsIn ternal(const RenderLayerModelObject* paintInvalidationContainer)
81 { 80 {
82 m_renderer.invalidatePaintUsingContainer(paintInvalidationContainer, m_rende rer.previousPaintInvalidationRect(), InvalidationLayer); 81 m_renderer.invalidatePaintUsingContainer(paintInvalidationContainer, m_rende rer.previousPaintInvalidationRect(), InvalidationLayer);
83 82
84 // Disable for reading compositingState() below.
85 DisableCompositingQueryAsserts disabler;
86
87 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr ->nextSibling()) { 83 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr ->nextSibling()) {
88 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin gState() != PaintsIntoGroupedBacking) 84 curr->paintInvalidator().paintInvalidationIncludingNonCompositingDescend antsInternal(paintInvalidationContainer);
89 curr->paintInvalidator().paintInvalidationIncludingNonCompositingDes cendantsInternal(paintInvalidationContainer);
90 } 85 }
91 } 86 }
92 87
93 LayoutRect RenderLayerRepainter::paintInvalidationRectIncludingNonCompositingDes cendants() const 88 LayoutRect RenderLayerRepainter::paintInvalidationRectIncludingNonCompositingDes cendants() const
94 { 89 {
95 LayoutRect paintInvalidationRect = m_renderer.previousPaintInvalidationRect( ); 90 LayoutRect paintInvalidationRect = m_renderer.previousPaintInvalidationRect( );
96 91
97 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c hild->nextSibling()) { 92 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c hild->nextSibling()) {
98 // Don't include paint invalidation rects for composited child layers; t hey will paint themselves and have a different origin.
99 if (child->compositingState() == PaintsIntoOwnBacking || child->composit ingState() == PaintsIntoGroupedBacking)
100 continue;
101
102 paintInvalidationRect.unite(child->paintInvalidator().paintInvalidationR ectIncludingNonCompositingDescendants()); 93 paintInvalidationRect.unite(child->paintInvalidator().paintInvalidationR ectIncludingNonCompositingDescendants());
103 } 94 }
104 return paintInvalidationRect; 95 return paintInvalidationRect;
105 } 96 }
106 97
107 void RenderLayerRepainter::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r) 98 void RenderLayerRepainter::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r)
108 { 99 {
109 // FIXME(sky): Remove. 100 // FIXME(sky): Remove.
110 ASSERT_NOT_REACHED(); 101 ASSERT_NOT_REACHED();
111 } 102 }
(...skipping 24 matching lines...) Expand all
136 view->invalidatePaintForRectangle(parentLayerRect); 127 view->invalidatePaintForRectangle(parentLayerRect);
137 return; 128 return;
138 } 129 }
139 130
140 ASSERT_NOT_REACHED(); 131 ASSERT_NOT_REACHED();
141 } 132 }
142 133
143 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const 134 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const
144 { 135 {
145 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) { 136 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) {
146 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) 137 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->isRootLayer())
147 return const_cast<RenderLayer*>(curr); 138 return const_cast<RenderLayer*>(curr);
148 } 139 }
149 return 0; 140 return 0;
150 } 141 }
151 142
152 } // namespace blink 143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698