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/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // These two calls must come before updating the pile, because they may | 71 // These two calls must come before updating the pile, because they may |
72 // destroy tiles that the new pile cannot raster. | 72 // destroy tiles that the new pile cannot raster. |
73 this_tiling->SetLayerBounds(new_layer_bounds); | 73 this_tiling->SetLayerBounds(new_layer_bounds); |
74 this_tiling->Invalidate(layer_invalidation); | 74 this_tiling->Invalidate(layer_invalidation); |
75 | 75 |
76 this_tiling->UpdateTilesToCurrentPile(); | 76 this_tiling->UpdateTilesToCurrentPile(); |
77 this_tiling->CreateMissingTilesInLiveTilesRect(); | 77 this_tiling->CreateMissingTilesInLiveTilesRect(); |
78 | 78 |
79 DCHECK(this_tiling->tile_size() == | 79 DCHECK(this_tiling->tile_size() == |
80 client_->CalculateTileSize(this_tiling->ContentRect().size())); | 80 client_->CalculateTileSize(this_tiling->TilingRect().size())); |
81 continue; | 81 continue; |
82 } | 82 } |
83 scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create( | 83 scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create( |
84 contents_scale, | 84 contents_scale, |
85 new_layer_bounds, | 85 new_layer_bounds, |
86 client_); | 86 client_); |
87 new_tiling->set_resolution(other.tilings_[i]->resolution()); | 87 new_tiling->set_resolution(other.tilings_[i]->resolution()); |
88 tilings_.push_back(new_tiling.Pass()); | 88 tilings_.push_back(new_tiling.Pass()); |
89 } | 89 } |
90 tilings_.sort(LargestToSmallestScaleFunctor()); | 90 tilings_.sort(LargestToSmallestScaleFunctor()); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 | 345 |
346 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { | 346 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { |
347 size_t amount = 0; | 347 size_t amount = 0; |
348 for (size_t i = 0; i < tilings_.size(); ++i) | 348 for (size_t i = 0; i < tilings_.size(); ++i) |
349 amount += tilings_[i]->GPUMemoryUsageInBytes(); | 349 amount += tilings_[i]->GPUMemoryUsageInBytes(); |
350 return amount; | 350 return amount; |
351 } | 351 } |
352 | 352 |
353 } // namespace cc | 353 } // namespace cc |
OLD | NEW |