| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/tiles/picture_layer_tiling.h" | 5 #include "cc/tiles/picture_layer_tiling.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (after_bottom > before_bottom) { | 249 if (after_bottom > before_bottom) { |
| 250 DCHECK_EQ(after_bottom, before_bottom + 1); | 250 DCHECK_EQ(after_bottom, before_bottom + 1); |
| 251 for (int i = before_left; i <= before_right; ++i) { | 251 for (int i = before_left; i <= before_right; ++i) { |
| 252 if (ShouldCreateTileAt(i, after_bottom)) | 252 if (ShouldCreateTileAt(i, after_bottom)) |
| 253 CreateTile(i, after_bottom); | 253 CreateTile(i, after_bottom); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 void PictureLayerTiling::Invalidate(const Region& layer_invalidation) { | 258 void PictureLayerTiling::Invalidate(const Region& layer_invalidation) { |
| 259 DCHECK_IMPLIES(tree_ == ACTIVE_TREE, | 259 DCHECK((tree_ != ACTIVE_TREE) || |
| 260 !client_->GetPendingOrActiveTwinTiling(this)); | 260 !client_->GetPendingOrActiveTwinTiling(this)); |
| 261 RemoveTilesInRegion(layer_invalidation, true /* recreate tiles */); | 261 RemoveTilesInRegion(layer_invalidation, true /* recreate tiles */); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void PictureLayerTiling::RemoveTilesInRegion(const Region& layer_invalidation, | 264 void PictureLayerTiling::RemoveTilesInRegion(const Region& layer_invalidation, |
| 265 bool recreate_tiles) { | 265 bool recreate_tiles) { |
| 266 // We only invalidate the active tiling when it's orphaned: it has no pending | 266 // We only invalidate the active tiling when it's orphaned: it has no pending |
| 267 // twin, so it's slated for removal in the future. | 267 // twin, so it's slated for removal in the future. |
| 268 if (live_tiles_rect_.IsEmpty()) | 268 if (live_tiles_rect_.IsEmpty()) |
| 269 return; | 269 return; |
| 270 // Pick 16 for the size of the SmallMap before it promotes to a hash_map. | 270 // Pick 16 for the size of the SmallMap before it promotes to a hash_map. |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 break; | 1111 break; |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 gfx::Rect result(origin_x, origin_y, width, height); | 1114 gfx::Rect result(origin_x, origin_y, width, height); |
| 1115 if (cache) | 1115 if (cache) |
| 1116 cache->previous_result = result; | 1116 cache->previous_result = result; |
| 1117 return result; | 1117 return result; |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 } // namespace cc | 1120 } // namespace cc |
| OLD | NEW |