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

Side by Side Diff: Source/core/rendering/RenderLayerRepainter.cpp

Issue 498773007: Move some scroll invalidations to the paint invalidation phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch updated after Dan's review. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayerRepainter.h ('k') | Source/platform/scroll/ScrollView.h » ('j') | 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Disable for reading compositingState() below. 85 // Disable for reading compositingState() below.
86 DisableCompositingQueryAsserts disabler; 86 DisableCompositingQueryAsserts disabler;
87 87
88 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr ->nextSibling()) { 88 for (RenderLayer* curr = m_renderer.layer()->firstChild(); curr; curr = curr ->nextSibling()) {
89 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin gState() != PaintsIntoGroupedBacking) 89 if (curr->compositingState() != PaintsIntoOwnBacking && curr->compositin gState() != PaintsIntoGroupedBacking)
90 curr->paintInvalidator().paintInvalidationIncludingNonCompositingDes cendantsInternal(paintInvalidationContainer); 90 curr->paintInvalidator().paintInvalidationIncludingNonCompositingDes cendantsInternal(paintInvalidationContainer);
91 } 91 }
92 } 92 }
93 93
94 LayoutRect RenderLayerRepainter::paintInvalidationRectIncludingNonCompositingDes cendants() const
95 {
96 LayoutRect paintInvalidationRect = m_renderer.previousPaintInvalidationRect( );
97
98 for (RenderLayer* child = m_renderer.layer()->firstChild(); child; child = c hild->nextSibling()) {
99 // Don't include paint invalidation rects for composited child layers; t hey will paint themselves and have a different origin.
100 if (child->compositingState() == PaintsIntoOwnBacking || child->composit ingState() == PaintsIntoGroupedBacking)
101 continue;
102
103 paintInvalidationRect.unite(child->paintInvalidator().paintInvalidationR ectIncludingNonCompositingDescendants());
104 }
105 return paintInvalidationRect;
106 }
107
108 void RenderLayerRepainter::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r) 94 void RenderLayerRepainter::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r)
109 { 95 {
110 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 96 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
111 // so assert but check that the layer is composited. 97 // so assert but check that the layer is composited.
112 ASSERT(m_renderer.compositingState() != NotComposited); 98 ASSERT(m_renderer.compositingState() != NotComposited);
113 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic. 99 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic.
114 if (m_renderer.layer()->groupedMapping()) { 100 if (m_renderer.layer()->groupedMapping()) {
115 LayoutRect paintInvalidationRect = r; 101 LayoutRect paintInvalidationRect = r;
116 paintInvalidationRect.move(m_renderer.layer()->subpixelAccumulation()); 102 paintInvalidationRect.move(m_renderer.layer()->subpixelAccumulation());
117 if (GraphicsLayer* squashingLayer = m_renderer.layer()->groupedMapping() ->squashingLayer()) 103 if (GraphicsLayer* squashingLayer = m_renderer.layer()->groupedMapping() ->squashingLayer())
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const 145 RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const
160 { 146 {
161 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) { 147 for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent ()) {
162 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer()) 148 if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilter s()) || curr->compositingState() == PaintsIntoOwnBacking || curr->isRootLayer())
163 return const_cast<RenderLayer*>(curr); 149 return const_cast<RenderLayer*>(curr);
164 } 150 }
165 return 0; 151 return 0;
166 } 152 }
167 153
168 } // namespace blink 154 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerRepainter.h ('k') | Source/platform/scroll/ScrollView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698