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

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

Issue 434453002: Promote inlines to first-class invalidation citizens (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: This is up to date... Created 6 years, 4 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/RenderLayerModelObject.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // to marking entire layers instead. This may sometimes mark more th an necessary (when 170 // to marking entire layers instead. This may sometimes mark more th an necessary (when
171 // a layer is made of disjoint objects) but in practice is a signifi cant performance 171 // a layer is made of disjoint objects) but in practice is a signifi cant performance
172 // savings. 172 // savings.
173 layer()->addLayerHitTestRects(rects); 173 layer()->addLayerHitTestRects(rects);
174 } 174 }
175 } else { 175 } else {
176 RenderObject::addLayerHitTestRects(rects, currentLayer, layerOffset, con tainerRect); 176 RenderObject::addLayerHitTestRects(rects, currentLayer, layerOffset, con tainerRect);
177 } 177 }
178 } 178 }
179 179
180 InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintIn validationState& paintInvalidationState, const RenderLayerModelObject& newPaintI nvalidationContainer)
181 {
182 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
183 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
184 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
185 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
186
187 // If we are set to do a full paint invalidation that means the RenderView w ill issue
188 // paint invalidations. We can then skip issuing of paint invalidations for the child
189 // renderers as they'll be covered by the RenderView.
190 if (view()->doingFullPaintInvalidation())
191 return InvalidationNone;
192
193 return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvali dationState);
194 }
195
196 void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState & paintInvalidationState)
197 {
198 // FIXME: SVG should probably also go through this unified paint invalidatio n system.
199 ASSERT(!needsLayout());
200
201 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
202 return;
203
204 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer ();
205 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
206 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
207
208 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
209
210 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
211 if (reason == InvalidationLocationChange || reason == InvalidationFull)
212 childTreeWalkState.setForceCheckForPaintInvalidation();
213 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
214 }
215
180 } // namespace blink 216 } // namespace blink
181 217
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698