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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 should_use_gpu_rasterization()) | 507 should_use_gpu_rasterization()) |
508 return NULL; | 508 return NULL; |
509 for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i) | 509 for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i) |
510 if (twin_layer_->tilings_->tiling_at(i)->contents_scale() == | 510 if (twin_layer_->tilings_->tiling_at(i)->contents_scale() == |
511 tiling->contents_scale()) | 511 tiling->contents_scale()) |
512 return twin_layer_->tilings_->tiling_at(i); | 512 return twin_layer_->tilings_->tiling_at(i); |
513 return NULL; | 513 return NULL; |
514 } | 514 } |
515 | 515 |
516 gfx::Size PictureLayerImpl::CalculateTileSize( | 516 gfx::Size PictureLayerImpl::CalculateTileSize( |
517 gfx::Size content_bounds) const { | 517 const gfx::Size& content_bounds) const { |
518 if (is_mask_) { | 518 if (is_mask_) { |
519 int max_size = layer_tree_impl()->MaxTextureSize(); | 519 int max_size = layer_tree_impl()->MaxTextureSize(); |
520 return gfx::Size( | 520 return gfx::Size( |
521 std::min(max_size, content_bounds.width()), | 521 std::min(max_size, content_bounds.width()), |
522 std::min(max_size, content_bounds.height())); | 522 std::min(max_size, content_bounds.height())); |
523 } | 523 } |
524 | 524 |
525 int max_texture_size = | 525 int max_texture_size = |
526 layer_tree_impl()->resource_provider()->max_texture_size(); | 526 layer_tree_impl()->resource_provider()->max_texture_size(); |
527 | 527 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1231 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1232 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); | 1232 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); |
1233 return tilings_->GPUMemoryUsageInBytes(); | 1233 return tilings_->GPUMemoryUsageInBytes(); |
1234 } | 1234 } |
1235 | 1235 |
1236 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1236 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1237 benchmark->RunOnLayer(this); | 1237 benchmark->RunOnLayer(this); |
1238 } | 1238 } |
1239 | 1239 |
1240 } // namespace cc | 1240 } // namespace cc |
OLD | NEW |