| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/fake_picture_layer_impl.h" | 5 #include "cc/test/fake_picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include "cc/resources/tile.h" | 8 #include "cc/resources/tile.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 gfx::Size FakePictureLayerImpl::CalculateTileSize( | 65 gfx::Size FakePictureLayerImpl::CalculateTileSize( |
| 66 const gfx::Size& content_bounds) const { | 66 const gfx::Size& content_bounds) const { |
| 67 if (fixed_tile_size_.IsEmpty()) { | 67 if (fixed_tile_size_.IsEmpty()) { |
| 68 return PictureLayerImpl::CalculateTileSize(content_bounds); | 68 return PictureLayerImpl::CalculateTileSize(content_bounds); |
| 69 } | 69 } |
| 70 | 70 |
| 71 return fixed_tile_size_; | 71 return fixed_tile_size_; |
| 72 } | 72 } |
| 73 | 73 |
| 74 PictureLayerTiling* FakePictureLayerImpl::HighResTiling() const { | 74 PictureLayerTiling* FakePictureLayerImpl::HighResTiling() const { |
| 75 PictureLayerTiling* result = NULL; | 75 PictureLayerTiling* result = nullptr; |
| 76 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 76 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 77 PictureLayerTiling* tiling = tilings_->tiling_at(i); | 77 PictureLayerTiling* tiling = tilings_->tiling_at(i); |
| 78 if (tiling->resolution() == HIGH_RESOLUTION) { | 78 if (tiling->resolution() == HIGH_RESOLUTION) { |
| 79 // There should be only one high res tiling. | 79 // There should be only one high res tiling. |
| 80 CHECK(!result); | 80 CHECK(!result); |
| 81 result = tiling; | 81 result = tiling; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 return result; | 84 return result; |
| 85 } | 85 } |
| 86 | 86 |
| 87 PictureLayerTiling* FakePictureLayerImpl::LowResTiling() const { | 87 PictureLayerTiling* FakePictureLayerImpl::LowResTiling() const { |
| 88 PictureLayerTiling* result = NULL; | 88 PictureLayerTiling* result = nullptr; |
| 89 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 89 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 90 PictureLayerTiling* tiling = tilings_->tiling_at(i); | 90 PictureLayerTiling* tiling = tilings_->tiling_at(i); |
| 91 if (tiling->resolution() == LOW_RESOLUTION) { | 91 if (tiling->resolution() == LOW_RESOLUTION) { |
| 92 // There should be only one low res tiling. | 92 // There should be only one low res tiling. |
| 93 CHECK(!result); | 93 CHECK(!result); |
| 94 result = tiling; | 94 result = tiling; |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 return result; | 97 return result; |
| 98 } | 98 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ? has_valid_tile_priorities_ | 179 ? has_valid_tile_priorities_ |
| 180 : PictureLayerImpl::HasValidTilePriorities(); | 180 : PictureLayerImpl::HasValidTilePriorities(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void FakePictureLayerImpl::ReleaseResources() { | 183 void FakePictureLayerImpl::ReleaseResources() { |
| 184 PictureLayerImpl::ReleaseResources(); | 184 PictureLayerImpl::ReleaseResources(); |
| 185 ++release_resources_count_; | 185 ++release_resources_count_; |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace cc | 188 } // namespace cc |
| OLD | NEW |