Chromium Code Reviews| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 { | 59 { |
| 60 } | 60 } |
| 61 | 61 |
| 62 void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, UpdateType updateType , GraphicsLayerVector& childLayersOfEnclosingLayer, int depth) | 62 void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, UpdateType updateType , GraphicsLayerVector& childLayersOfEnclosingLayer, int depth) |
| 63 { | 63 { |
| 64 // Make the layer compositing if necessary, and set up clipping and content layers. | 64 // Make the layer compositing if necessary, and set up clipping and content layers. |
| 65 // Note that we can only do work here that is independent of whether the des cendant layers | 65 // Note that we can only do work here that is independent of whether the des cendant layers |
| 66 // have been processed. computeCompositingRequirements() will already have d one the repaint if necessary. | 66 // have been processed. computeCompositingRequirements() will already have d one the repaint if necessary. |
| 67 | 67 |
| 68 layer.stackingNode()->updateLayerListsIfNeeded(); | 68 layer.stackingNode()->updateLayerListsIfNeeded(); |
| 69 layer.update3dRenderingContext(); | |
| 70 | 69 |
| 71 const bool hasCompositedLayerMapping = layer.hasCompositedLayerMapping(); | 70 const bool hasCompositedLayerMapping = layer.hasCompositedLayerMapping(); |
| 72 CompositedLayerMappingPtr currentCompositedLayerMapping = layer.compositedLa yerMapping(); | 71 CompositedLayerMappingPtr currentCompositedLayerMapping = layer.compositedLa yerMapping(); |
| 73 | 72 |
| 74 updateType = update(layer, updateType); | 73 updateType = update(layer, updateType); |
| 75 | 74 |
| 76 // Grab some stats for histograms. | 75 // Grab some stats for histograms. |
| 77 if (hasCompositedLayerMapping) { | 76 if (hasCompositedLayerMapping) { |
| 78 m_pixelsWithoutPromotingAllTransitions += layer.size().height() * layer. size().width(); | 77 m_pixelsWithoutPromotingAllTransitions += layer.size().height() * layer. size().width(); |
| 79 } else { | 78 } else { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 LayerListMutationDetector mutationChecker(layer.stackingNode()); | 151 LayerListMutationDetector mutationChecker(layer.stackingNode()); |
| 153 #endif | 152 #endif |
| 154 | 153 |
| 155 RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), AllChildren) ; | 154 RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), AllChildren) ; |
| 156 while (RenderLayerStackingNode* curNode = iterator.next()) | 155 while (RenderLayerStackingNode* curNode = iterator.next()) |
| 157 updateRecursive(*curNode->layer(), updateType); | 156 updateRecursive(*curNode->layer(), updateType); |
| 158 } | 157 } |
| 159 | 158 |
| 160 GraphicsLayerUpdater::UpdateType GraphicsLayerUpdater::update(RenderLayer& layer , UpdateType updateType) | 159 GraphicsLayerUpdater::UpdateType GraphicsLayerUpdater::update(RenderLayer& layer , UpdateType updateType) |
| 161 { | 160 { |
| 161 | |
|
ojan
2014/03/25 01:36:00
Did you mean to add this?
abarth-chromium
2014/03/25 02:31:38
Nope! That was from an earlier iteration where I
| |
| 162 if (!layer.hasCompositedLayerMapping()) | 162 if (!layer.hasCompositedLayerMapping()) |
| 163 return updateType; | 163 return updateType; |
| 164 | 164 |
| 165 CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); | 165 CompositedLayerMappingPtr mapping = layer.compositedLayerMapping(); |
| 166 | 166 |
| 167 // Note carefully: here we assume that the compositing state of all descenda nts have been updated already, | 167 // Note carefully: here we assume that the compositing state of all descenda nts have been updated already, |
| 168 // so it is legitimate to compute and cache the composited bounds for this l ayer. | 168 // so it is legitimate to compute and cache the composited bounds for this l ayer. |
| 169 mapping->updateCompositedBounds(updateType); | 169 mapping->updateCompositedBounds(updateType); |
| 170 | 170 |
| 171 if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) { | 171 if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) { |
| 172 if (reflection->reflectionLayer()->hasCompositedLayerMapping()) | 172 if (reflection->reflectionLayer()->hasCompositedLayerMapping()) |
| 173 reflection->reflectionLayer()->compositedLayerMapping()->updateCompo sitedBounds(ForceUpdate); | 173 reflection->reflectionLayer()->compositedLayerMapping()->updateCompo sitedBounds(ForceUpdate); |
| 174 } | 174 } |
| 175 | 175 |
| 176 mapping->updateGraphicsLayerConfiguration(); | 176 mapping->updateGraphicsLayerConfiguration(); |
| 177 updateType = mapping->updateGraphicsLayerGeometry(updateType); | 177 updateType = mapping->updateGraphicsLayerGeometry(updateType); |
| 178 mapping->clearNeedsGeometryUpdate(); | 178 mapping->clearNeedsGeometryUpdate(); |
| 179 | 179 |
| 180 if (!layer.parent()) | 180 if (!layer.parent()) |
| 181 layer.compositor()->updateRootLayerPosition(); | 181 layer.compositor()->updateRootLayerPosition(); |
| 182 | 182 |
| 183 if (mapping->hasUnpositionedOverflowControlsLayers()) | 183 if (mapping->hasUnpositionedOverflowControlsLayers()) |
| 184 layer.scrollableArea()->positionOverflowControls(); | 184 layer.scrollableArea()->positionOverflowControls(); |
| 185 | 185 |
| 186 return updateType; | 186 return updateType; |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace WebCore | 189 } // namespace WebCore |
| OLD | NEW |