| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 GraphicsLayerUpdater::GraphicsLayerUpdater() | 56 GraphicsLayerUpdater::GraphicsLayerUpdater() |
| 57 : m_needsRebuildTree(false) | 57 : m_needsRebuildTree(false) |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 GraphicsLayerUpdater::~GraphicsLayerUpdater() | 61 GraphicsLayerUpdater::~GraphicsLayerUpdater() |
| 62 { | 62 { |
| 63 } | 63 } |
| 64 | 64 |
| 65 void GraphicsLayerUpdater::update(RenderLayer& layer, UpdateType updateType, con
st UpdateContext& context) | 65 void GraphicsLayerUpdater::update(Vector<RenderLayer*>& layersNeedingPaintInvali
dation, RenderLayer& layer, UpdateType updateType, const UpdateContext& context) |
| 66 { | 66 { |
| 67 if (layer.hasCompositedLayerMapping()) { | 67 if (layer.hasCompositedLayerMapping()) { |
| 68 CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); | 68 CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); |
| 69 | 69 |
| 70 const RenderLayer* compositingContainer = context.compositingContainer(l
ayer); | 70 const RenderLayer* compositingContainer = context.compositingContainer(l
ayer); |
| 71 ASSERT(compositingContainer == layer.ancestorCompositingLayer()); | 71 ASSERT(compositingContainer == layer.ancestorCompositingLayer()); |
| 72 if (mapping->updateRequiresOwnBackingStoreForAncestorReasons(compositing
Container)) | 72 if (mapping->updateRequiresOwnBackingStoreForAncestorReasons(compositing
Container)) |
| 73 updateType = ForceUpdate; | 73 updateType = ForceUpdate; |
| 74 | 74 |
| 75 // Note carefully: here we assume that the compositing state of all desc
endants have been updated already, | 75 // Note carefully: here we assume that the compositing state of all desc
endants have been updated already, |
| 76 // so it is legitimate to compute and cache the composited bounds for th
is layer. | 76 // so it is legitimate to compute and cache the composited bounds for th
is layer. |
| 77 mapping->updateCompositedBounds(updateType); | 77 mapping->updateCompositedBounds(updateType); |
| 78 | 78 |
| 79 if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) { | 79 if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) { |
| 80 if (reflection->reflectionLayer()->hasCompositedLayerMapping()) | 80 if (reflection->reflectionLayer()->hasCompositedLayerMapping()) |
| 81 reflection->reflectionLayer()->compositedLayerMapping()->updateC
ompositedBounds(ForceUpdate); | 81 reflection->reflectionLayer()->compositedLayerMapping()->updateC
ompositedBounds(ForceUpdate); |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (mapping->updateGraphicsLayerConfiguration(updateType)) | 84 if (mapping->updateGraphicsLayerConfiguration(updateType)) |
| 85 m_needsRebuildTree = true; | 85 m_needsRebuildTree = true; |
| 86 | 86 |
| 87 mapping->updateGraphicsLayerGeometry(updateType, compositingContainer); | 87 mapping->updateGraphicsLayerGeometry(updateType, compositingContainer, l
ayersNeedingPaintInvalidation); |
| 88 | 88 |
| 89 updateType = mapping->updateTypeForChildren(updateType); | 89 updateType = mapping->updateTypeForChildren(updateType); |
| 90 mapping->clearNeedsGraphicsLayerUpdate(); | 90 mapping->clearNeedsGraphicsLayerUpdate(); |
| 91 | 91 |
| 92 if (!layer.parent()) | 92 if (!layer.parent()) |
| 93 layer.compositor()->updateRootLayerPosition(); | 93 layer.compositor()->updateRootLayerPosition(); |
| 94 | 94 |
| 95 if (mapping->hasUnpositionedOverflowControlsLayers()) | 95 if (mapping->hasUnpositionedOverflowControlsLayers()) |
| 96 layer.scrollableArea()->positionOverflowControls(IntSize()); | 96 layer.scrollableArea()->positionOverflowControls(IntSize()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 UpdateContext childContext(context, layer); | 99 UpdateContext childContext(context, layer); |
| 100 for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibl
ing()) | 100 for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibl
ing()) |
| 101 update(*child, updateType, childContext); | 101 update(layersNeedingPaintInvalidation, *child, updateType, childContext)
; |
| 102 } | 102 } |
| 103 | 103 |
| 104 #if ASSERT_ENABLED | 104 #if ASSERT_ENABLED |
| 105 | 105 |
| 106 void GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(RenderLay
er& layer) | 106 void GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(RenderLay
er& layer) |
| 107 { | 107 { |
| 108 if (layer.hasCompositedLayerMapping()) | 108 if (layer.hasCompositedLayerMapping()) |
| 109 layer.compositedLayerMapping()->assertNeedsToUpdateGraphicsLayerBitsClea
red(); | 109 layer.compositedLayerMapping()->assertNeedsToUpdateGraphicsLayerBitsClea
red(); |
| 110 | 110 |
| 111 for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibl
ing()) | 111 for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibl
ing()) |
| 112 assertNeedsToUpdateGraphicsLayerBitsCleared(*child); | 112 assertNeedsToUpdateGraphicsLayerBitsCleared(*child); |
| 113 } | 113 } |
| 114 | 114 |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 } // namespace WebCore | 117 } // namespace WebCore |
| OLD | NEW |