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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 | 1185 |
1186 bool PictureLayerImpl::CanHaveTilingWithScale(float contents_scale) const { | 1186 bool PictureLayerImpl::CanHaveTilingWithScale(float contents_scale) const { |
1187 if (!CanHaveTilings()) | 1187 if (!CanHaveTilings()) |
1188 return false; | 1188 return false; |
1189 if (contents_scale < MinimumContentsScale()) | 1189 if (contents_scale < MinimumContentsScale()) |
1190 return false; | 1190 return false; |
1191 return true; | 1191 return true; |
1192 } | 1192 } |
1193 | 1193 |
1194 void PictureLayerImpl::SanityCheckTilingState() const { | 1194 void PictureLayerImpl::SanityCheckTilingState() const { |
1195 if (!DCHECK_IS_ON()) | 1195 #if DCHECK_IS_ON |
1196 return; | |
1197 | |
1198 if (!CanHaveTilings()) { | 1196 if (!CanHaveTilings()) { |
1199 DCHECK_EQ(0u, tilings_->num_tilings()); | 1197 DCHECK_EQ(0u, tilings_->num_tilings()); |
1200 return; | 1198 return; |
1201 } | 1199 } |
1202 if (tilings_->num_tilings() == 0) | 1200 if (tilings_->num_tilings() == 0) |
1203 return; | 1201 return; |
1204 | 1202 |
1205 // MarkVisibleResourcesAsRequired depends on having exactly 1 high res | 1203 // MarkVisibleResourcesAsRequired depends on having exactly 1 high res |
1206 // tiling to mark its tiles as being required for activation. | 1204 // tiling to mark its tiles as being required for activation. |
1207 DCHECK_EQ(1, tilings_->NumHighResTilings()); | 1205 DCHECK_EQ(1, tilings_->NumHighResTilings()); |
| 1206 #endif |
1208 } | 1207 } |
1209 | 1208 |
1210 void PictureLayerImpl::GetDebugBorderProperties( | 1209 void PictureLayerImpl::GetDebugBorderProperties( |
1211 SkColor* color, | 1210 SkColor* color, |
1212 float* width) const { | 1211 float* width) const { |
1213 *color = DebugColors::TiledContentLayerBorderColor(); | 1212 *color = DebugColors::TiledContentLayerBorderColor(); |
1214 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); | 1213 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); |
1215 } | 1214 } |
1216 | 1215 |
1217 void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const { | 1216 void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1250 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1252 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); | 1251 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); |
1253 return tilings_->GPUMemoryUsageInBytes(); | 1252 return tilings_->GPUMemoryUsageInBytes(); |
1254 } | 1253 } |
1255 | 1254 |
1256 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1255 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1257 benchmark->RunOnLayer(this); | 1256 benchmark->RunOnLayer(this); |
1258 } | 1257 } |
1259 | 1258 |
1260 } // namespace cc | 1259 } // namespace cc |
OLD | NEW |