OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/damage_tracker.h" | 5 #include "cc/damage_tracker.h" |
6 | 6 |
7 #include "cc/layer_impl.h" | 7 #include "cc/layer_impl.h" |
8 #include "cc/layer_tree_host_common.h" | 8 #include "cc/layer_tree_host_common.h" |
9 #include "cc/math_util.h" | 9 #include "cc/math_util.h" |
10 #include "cc/render_surface_impl.h" | 10 #include "cc/render_surface_impl.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 return gfx::RectF(); | 155 return gfx::RectF(); |
156 | 156 |
157 gfx::RectF ret = iter->second; | 157 gfx::RectF ret = iter->second; |
158 m_currentRectHistory->erase(iter); | 158 m_currentRectHistory->erase(iter); |
159 return ret; | 159 return ret; |
160 } | 160 } |
161 | 161 |
162 void DamageTracker::saveRectForNextFrame(int layerID, const gfx::RectF& targetSp aceRect) | 162 void DamageTracker::saveRectForNextFrame(int layerID, const gfx::RectF& targetSp aceRect) |
163 { | 163 { |
164 // This layer should not yet exist in next frame's history. | 164 // This layer should not yet exist in next frame's history. |
165 DCHECK(layerID > 0); | 165 DCHECK(layerID > 0 || layerID == -1 || layerID == -2); |
Ian Vollick
2013/01/15 20:33:48
I'll make a more detailed proposal about how to ha
| |
166 DCHECK(m_nextRectHistory->find(layerID) == m_nextRectHistory->end()); | 166 DCHECK(m_nextRectHistory->find(layerID) == m_nextRectHistory->end()); |
167 (*m_nextRectHistory)[layerID] = targetSpaceRect; | 167 (*m_nextRectHistory)[layerID] = targetSpaceRect; |
168 } | 168 } |
169 | 169 |
170 gfx::RectF DamageTracker::trackDamageFromActiveLayers(const std::vector<LayerImp l*>& layerList, int targetSurfaceLayerID) | 170 gfx::RectF DamageTracker::trackDamageFromActiveLayers(const std::vector<LayerImp l*>& layerList, int targetSurfaceLayerID) |
171 { | 171 { |
172 gfx::RectF damageRect = gfx::RectF(); | 172 gfx::RectF damageRect = gfx::RectF(); |
173 | 173 |
174 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { | 174 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { |
175 // Visit layers in back-to-front order. | 175 // Visit layers in back-to-front order. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 | 332 |
333 // If the layer has a background filter, this may cause pixels in our surfac e to be expanded, so we will need to expand any damage | 333 // If the layer has a background filter, this may cause pixels in our surfac e to be expanded, so we will need to expand any damage |
334 // at or below this layer. We expand the damage from this layer too, as we n eed to readback those pixels from the surface with only | 334 // at or below this layer. We expand the damage from this layer too, as we n eed to readback those pixels from the surface with only |
335 // the contents of layers below this one in them. This means we need to redr aw any pixels in the surface being used for the blur in | 335 // the contents of layers below this one in them. This means we need to redr aw any pixels in the surface being used for the blur in |
336 // this layer this frame. | 336 // this layer this frame. |
337 if (layer->backgroundFilters().hasFilterThatMovesPixels()) | 337 if (layer->backgroundFilters().hasFilterThatMovesPixels()) |
338 expandDamageRectInsideRectWithFilters(targetDamageRect, surfaceRectInTar getSpace, layer->backgroundFilters()); | 338 expandDamageRectInsideRectWithFilters(targetDamageRect, surfaceRectInTar getSpace, layer->backgroundFilters()); |
339 } | 339 } |
340 | 340 |
341 } // namespace cc | 341 } // namespace cc |
OLD | NEW |