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 // If |layer| was added to an already-existing squashing layer, issue re
paints. |
| 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,
issue repaints. |
| 202 |
| 203 m_compositor->repaintOnCompositingChange(layer); |
201 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(); | 204 layer->groupedMapping()->setNeedsGraphicsLayerUpdate(); |
202 layer->setGroupedMapping(0); | 205 layer->setGroupedMapping(0); |
203 } | 206 } |
204 | 207 |
205 // This layer and all of its descendants have cached repaints rects that
are relative to | 208 // 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. | 209 // the repaint container, so change when compositing changes; we need to
update them here. |
207 layer->repainter().computeRepaintRectsIncludingDescendants(); | 210 layer->repainter().computeRepaintRectsIncludingDescendants(); |
208 | 211 |
209 // If we need to repaint, do so now that we've removed it from a squashe
d layer | 212 // If we need to repaint, do so now that we've removed it from a squashe
d layer |
210 m_compositor->repaintOnCompositingChange(layer); | 213 m_compositor->repaintOnCompositingChange(layer); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 275 |
273 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); | 276 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowC
hildren | PositiveZOrderChildren); |
274 while (RenderLayerStackingNode* curNode = iterator.next()) | 277 while (RenderLayerStackingNode* curNode = iterator.next()) |
275 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC
hanged); | 278 assignLayersToBackingsInternal(curNode->layer(), squashingState, layersC
hanged); |
276 | 279 |
277 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) | 280 if (squashingState.hasMostRecentMapping && &squashingState.mostRecentMapping
->owningLayer() == layer) |
278 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 281 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
279 } | 282 } |
280 | 283 |
281 } | 284 } |
OLD | NEW |