| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // the graphics layer geometry. | 237 // the graphics layer geometry. |
| 238 squashingState.mostRecentMapping->setNeedsGraphicsLayerUpdate( | 238 squashingState.mostRecentMapping->setNeedsGraphicsLayerUpdate( |
| 239 GraphicsLayerUpdateSubtree); | 239 GraphicsLayerUpdateSubtree); |
| 240 | 240 |
| 241 layer->clipper().clearClipRectsIncludingDescendants(); | 241 layer->clipper().clearClipRectsIncludingDescendants(); |
| 242 | 242 |
| 243 // Issue a paint invalidation, since |layer| may have been added to an | 243 // Issue a paint invalidation, since |layer| may have been added to an |
| 244 // already-existing squashing layer. | 244 // already-existing squashing layer. |
| 245 TRACE_LAYER_INVALIDATION( | 245 TRACE_LAYER_INVALIDATION( |
| 246 layer, InspectorLayerInvalidationTrackingEvent::AddedToSquashingLayer); | 246 layer, InspectorLayerInvalidationTrackingEvent::AddedToSquashingLayer); |
| 247 layersNeedingPaintInvalidation.append(layer); | 247 layersNeedingPaintInvalidation.push_back(layer); |
| 248 m_layersChanged = true; | 248 m_layersChanged = true; |
| 249 } else if (compositedLayerUpdate == RemoveFromSquashingLayer) { | 249 } else if (compositedLayerUpdate == RemoveFromSquashingLayer) { |
| 250 if (layer->groupedMapping()) { | 250 if (layer->groupedMapping()) { |
| 251 // Before removing |layer| from an already-existing squashing layer that | 251 // Before removing |layer| from an already-existing squashing layer that |
| 252 // may have other content, issue a paint invalidation. | 252 // may have other content, issue a paint invalidation. |
| 253 m_compositor->paintInvalidationOnCompositingChange(layer); | 253 m_compositor->paintInvalidationOnCompositingChange(layer); |
| 254 layer->groupedMapping()->setNeedsGraphicsLayerUpdate( | 254 layer->groupedMapping()->setNeedsGraphicsLayerUpdate( |
| 255 GraphicsLayerUpdateSubtree); | 255 GraphicsLayerUpdateSubtree); |
| 256 layer->setGroupedMapping(nullptr, | 256 layer->setGroupedMapping(nullptr, |
| 257 PaintLayer::InvalidateLayerAndRemoveFromMapping); | 257 PaintLayer::InvalidateLayerAndRemoveFromMapping); |
| 258 } | 258 } |
| 259 | 259 |
| 260 // If we need to issue paint invalidations, do so now that we've removed it | 260 // If we need to issue paint invalidations, do so now that we've removed it |
| 261 // from a squashed layer. | 261 // from a squashed layer. |
| 262 TRACE_LAYER_INVALIDATION( | 262 TRACE_LAYER_INVALIDATION( |
| 263 layer, | 263 layer, |
| 264 InspectorLayerInvalidationTrackingEvent::RemovedFromSquashingLayer); | 264 InspectorLayerInvalidationTrackingEvent::RemovedFromSquashingLayer); |
| 265 layersNeedingPaintInvalidation.append(layer); | 265 layersNeedingPaintInvalidation.push_back(layer); |
| 266 m_layersChanged = true; | 266 m_layersChanged = true; |
| 267 | 267 |
| 268 layer->setLostGroupedMapping(false); | 268 layer->setLostGroupedMapping(false); |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 static ScrollingCoordinator* scrollingCoordinatorFromLayer(PaintLayer& layer) { | 272 static ScrollingCoordinator* scrollingCoordinatorFromLayer(PaintLayer& layer) { |
| 273 Page* page = layer.layoutObject()->frame()->page(); | 273 Page* page = layer.layoutObject()->frame()->page(); |
| 274 return (!page) ? nullptr : page->scrollingCoordinator(); | 274 return (!page) ? nullptr : page->scrollingCoordinator(); |
| 275 } | 275 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 CompositingStateTransitionType compositedLayerUpdate = | 291 CompositingStateTransitionType compositedLayerUpdate = |
| 292 computeCompositedLayerUpdate(layer); | 292 computeCompositedLayerUpdate(layer); |
| 293 | 293 |
| 294 if (m_compositor->allocateOrClearCompositedLayerMapping( | 294 if (m_compositor->allocateOrClearCompositedLayerMapping( |
| 295 layer, compositedLayerUpdate)) { | 295 layer, compositedLayerUpdate)) { |
| 296 TRACE_LAYER_INVALIDATION( | 296 TRACE_LAYER_INVALIDATION( |
| 297 layer, InspectorLayerInvalidationTrackingEvent::NewCompositedLayer); | 297 layer, InspectorLayerInvalidationTrackingEvent::NewCompositedLayer); |
| 298 layersNeedingPaintInvalidation.append(layer); | 298 layersNeedingPaintInvalidation.push_back(layer); |
| 299 m_layersChanged = true; | 299 m_layersChanged = true; |
| 300 if (ScrollingCoordinator* scrollingCoordinator = | 300 if (ScrollingCoordinator* scrollingCoordinator = |
| 301 scrollingCoordinatorFromLayer(*layer)) { | 301 scrollingCoordinatorFromLayer(*layer)) { |
| 302 if (layer->layoutObject()->style()->hasViewportConstrainedPosition()) | 302 if (layer->layoutObject()->style()->hasViewportConstrainedPosition()) |
| 303 scrollingCoordinator->frameViewFixedObjectsDidChange( | 303 scrollingCoordinator->frameViewFixedObjectsDidChange( |
| 304 layer->layoutObject()->view()->frameView()); | 304 layer->layoutObject()->view()->frameView()); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 // Add this layer to a squashing backing if needed. | 308 // Add this layer to a squashing backing if needed. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 while (PaintLayerStackingNode* curNode = iterator.next()) | 348 while (PaintLayerStackingNode* curNode = iterator.next()) |
| 349 assignLayersToBackingsInternal(curNode->layer(), squashingState, | 349 assignLayersToBackingsInternal(curNode->layer(), squashingState, |
| 350 layersNeedingPaintInvalidation); | 350 layersNeedingPaintInvalidation); |
| 351 | 351 |
| 352 if (squashingState.hasMostRecentMapping && | 352 if (squashingState.hasMostRecentMapping && |
| 353 &squashingState.mostRecentMapping->owningLayer() == layer) | 353 &squashingState.mostRecentMapping->owningLayer() == layer) |
| 354 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; | 354 squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree = true; |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |