OLD | NEW |
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // to marking entire layers instead. This may sometimes mark more th
an necessary (when | 162 // to marking entire layers instead. This may sometimes mark more th
an necessary (when |
163 // a layer is made of disjoint objects) but in practice is a signifi
cant performance | 163 // a layer is made of disjoint objects) but in practice is a signifi
cant performance |
164 // savings. | 164 // savings. |
165 layer()->addLayerHitTestRects(rects); | 165 layer()->addLayerHitTestRects(rects); |
166 } | 166 } |
167 } else { | 167 } else { |
168 RenderObject::addLayerHitTestRects(rects, currentLayer, layerOffset, con
tainerRect); | 168 RenderObject::addLayerHitTestRects(rects, currentLayer, layerOffset, con
tainerRect); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintIn
validationState& paintInvalidationState, const RenderLayerModelObject& newPaintI
nvalidationContainer) | |
173 { | |
174 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | |
175 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi
onFromPaintInvalidationContainer(); | |
176 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv
alidationContainer, &paintInvalidationState)); | |
177 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP
aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati
onState)); | |
178 | |
179 // If we are set to do a full paint invalidation that means the RenderView w
ill issue | |
180 // paint invalidations. We can then skip issuing of paint invalidations for
the child | |
181 // renderers as they'll be covered by the RenderView. | |
182 if (view()->doingFullPaintInvalidation()) | |
183 return InvalidationNone; | |
184 | |
185 return RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer,
oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvali
dationState); | |
186 } | |
187 | |
188 void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState
& paintInvalidationState) | 172 void RenderLayerModelObject::invalidateTreeIfNeeded(const PaintInvalidationState
& paintInvalidationState) |
189 { | 173 { |
190 // FIXME: SVG should probably also go through this unified paint invalidatio
n system. | |
191 ASSERT(!needsLayout()); | 174 ASSERT(!needsLayout()); |
192 | 175 |
193 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 176 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
194 return; | 177 return; |
195 | 178 |
196 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer
(); | 179 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer
(); |
197 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi
tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this
: &paintInvalidationState.paintInvalidationContainer()); | 180 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi
tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this
: &paintInvalidationState.paintInvalidationContainer()); |
198 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); | 181 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); |
199 | 182 |
200 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); | 183 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); |
| 184 clearPaintInvalidationState(paintInvalidationState); |
201 | 185 |
202 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); | 186 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); |
203 if (reason == InvalidationLocationChange || reason == InvalidationFull) | 187 if (reason == InvalidationLocationChange || reason == InvalidationFull) |
204 childTreeWalkState.setForceCheckForPaintInvalidation(); | 188 childTreeWalkState.setForceCheckForPaintInvalidation(); |
205 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | 189 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); |
206 } | 190 } |
207 | 191 |
208 } // namespace blink | 192 } // namespace blink |
209 | 193 |
OLD | NEW |