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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Keep track of the tilings that were used so that tilings that are | 207 // Keep track of the tilings that were used so that tilings that are |
208 // unused can be considered for removal. | 208 // unused can be considered for removal. |
209 std::vector<PictureLayerTiling*> seen_tilings; | 209 std::vector<PictureLayerTiling*> seen_tilings; |
210 | 210 |
211 for (PictureLayerTilingSet::CoverageIterator iter( | 211 for (PictureLayerTilingSet::CoverageIterator iter( |
212 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); | 212 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); |
213 iter; | 213 iter; |
214 ++iter) { | 214 ++iter) { |
215 gfx::Rect geometry_rect = iter.geometry_rect(); | 215 gfx::Rect geometry_rect = iter.geometry_rect(); |
216 if (!*iter || !iter->IsReadyToDraw()) { | 216 if (!*iter || !iter->IsReadyToDraw()) { |
217 if (DrawCheckerboardForMissingTiles()) { | 217 if (draw_checkerboard_for_missing_tiles()) { |
218 // TODO(enne): Figure out how to show debug "invalidated checker" color | 218 // TODO(enne): Figure out how to show debug "invalidated checker" color |
219 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); | 219 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); |
220 SkColor color = DebugColors::DefaultCheckerboardColor(); | 220 SkColor color = DebugColors::DefaultCheckerboardColor(); |
221 quad->SetNew(shared_quad_state, geometry_rect, color); | 221 quad->SetNew(shared_quad_state, geometry_rect, color); |
222 if (quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data)) | 222 if (quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data)) |
223 append_quads_data->num_missing_tiles++; | 223 append_quads_data->num_missing_tiles++; |
224 } else { | 224 } else { |
225 SkColor color = SafeOpaqueBackgroundColor(); | 225 SkColor color = SafeOpaqueBackgroundColor(); |
226 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); | 226 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); |
227 quad->SetNew(shared_quad_state, geometry_rect, color, false); | 227 quad->SetNew(shared_quad_state, geometry_rect, color, false); |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1222 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1223 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); | 1223 const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded(); |
1224 return tilings_->GPUMemoryUsageInBytes(); | 1224 return tilings_->GPUMemoryUsageInBytes(); |
1225 } | 1225 } |
1226 | 1226 |
1227 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1227 void PictureLayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1228 benchmark->RunOnLayer(this); | 1228 benchmark->RunOnLayer(this); |
1229 } | 1229 } |
1230 | 1230 |
1231 } // namespace cc | 1231 } // namespace cc |
OLD | NEW |