OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 squashingState.mostRecentMapping->updateSquashingLayerAssignment(lay
er, squashingState.mostRecentMapping->owningLayer(), squashingState.nextSquashed
LayerIndex); | 176 squashingState.mostRecentMapping->updateSquashingLayerAssignment(lay
er, squashingState.mostRecentMapping->owningLayer(), squashingState.nextSquashed
LayerIndex); |
177 if (!changedSquashingLayer) | 177 if (!changedSquashingLayer) |
178 return true; | 178 return true; |
179 | 179 |
180 // If we've modified the collection of squashed layers, we must update | 180 // If we've modified the collection of squashed layers, we must update |
181 // the graphics layer geometry. | 181 // the graphics layer geometry. |
182 squashingState.mostRecentMapping->setNeedsGraphicsLayerUpdate(); | 182 squashingState.mostRecentMapping->setNeedsGraphicsLayerUpdate(); |
183 | 183 |
184 layer->clipper().clearClipRectsIncludingDescendants(); | 184 layer->clipper().clearClipRectsIncludingDescendants(); |
185 | 185 |
186 // If we need to repaint, do so before allocating the layer to the squas
hing layer. | |
187 m_compositor->repaintOnCompositingChange(layer); | |
188 | |
189 // FIXME: it seems premature to compute this before all compositing stat
e has been updated? | 186 // FIXME: it seems premature to compute this before all compositing stat
e has been updated? |
190 // This layer and all of its descendants have cached repaints rects that
are relative to | 187 // This layer and all of its descendants have cached repaints rects that
are relative to |
191 // the repaint container, so change when compositing changes; we need to
update them here. | 188 // the repaint container, so change when compositing changes; we need to
update them here. |
192 | 189 |
193 // FIXME: what's up with parent()? | 190 // FIXME: what's up with parent()? |
194 if (layer->parent()) | 191 if (layer->parent()) |
195 layer->repainter().computeRepaintRectsIncludingDescendants(); | 192 layer->repainter().computeRepaintRectsIncludingDescendants(); |
196 | 193 |
| 194 // Issue a repaint, since |layer| may have been added to an already-exis
ting squashing layer. |
| 195 m_compositor->repaintOnCompositingChange(layer); |
| 196 |
197 return true; | 197 return true; |
198 } | 198 } |
199 if (compositedLayerUpdate == RemoveFromSquashingLayer) { | 199 if (compositedLayerUpdate == RemoveFromSquashingLayer) { |
200 if (layer->groupedMapping()) { | 200 if (layer->groupedMapping()) { |
| 201 // Before removing |layer| from an already-existing squashing layer
that may have other content, issue a repaint. |
| 202 m_compositor->repaintOnCompositingChange(layer); |
201 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(); | 203 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(); |
202 layer->setGroupedMapping(0); | 204 layer->setGroupedMapping(0); |
203 } | 205 } |
204 | 206 |
205 // This layer and all of its descendants have cached repaints rects that
are relative to | 207 // This layer and all of its descendants have cached repaints rects that
are relative to |
206 // the repaint container, so change when compositing changes; we need to
update them here. | 208 // the repaint container, so change when compositing changes; we need to
update them here. |
207 layer->repainter().computeRepaintRectsIncludingDescendants(); | 209 layer->repainter().computeRepaintRectsIncludingDescendants(); |
208 | 210 |
209 // If we need to repaint, do so now that we've removed it from a squashe
d layer | 211 // If we need to repaint, do so now that we've removed it from a squashe
d layer. |
210 m_compositor->repaintOnCompositingChange(layer); | 212 m_compositor->repaintOnCompositingChange(layer); |
211 | 213 |
212 layer->setLostGroupedMapping(false); | 214 layer->setLostGroupedMapping(false); |
213 return true; | 215 return true; |
214 } | 216 } |
215 | 217 |
216 return false; | 218 return false; |
217 } | 219 } |
218 | 220 |
219 void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLa
yer* reflectionLayer, bool& layersChanged) | 221 void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLa
yer* reflectionLayer, bool& layersChanged) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 274 |
273 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); | 275 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); |
274 while (RenderLayerStackingNode* curNode = iterator.next()) | 276 while (RenderLayerStackingNode* curNode = iterator.next()) |
275 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC
hanged); | 277 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC
hanged); |
276 | 278 |
277 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) | 279 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) |
278 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 280 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
279 } | 281 } |
280 | 282 |
281 } | 283 } |
OLD | NEW |