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_pile.h" | 5 #include "cc/resources/picture_pile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 num_raster_threads, | 364 num_raster_threads, |
365 recording_mode); | 365 recording_mode); |
366 // Note the '&&' with previous is-suitable state. | 366 // Note the '&&' with previous is-suitable state. |
367 // This means that once a picture-pile becomes unsuitable for gpu | 367 // This means that once a picture-pile becomes unsuitable for gpu |
368 // rasterization due to some content, it will continue to be unsuitable | 368 // rasterization due to some content, it will continue to be unsuitable |
369 // even if that content is replaced by gpu-friendly content. | 369 // even if that content is replaced by gpu-friendly content. |
370 // This is an optimization to avoid iterating though all pictures in | 370 // This is an optimization to avoid iterating though all pictures in |
371 // the pile after each invalidation. | 371 // the pile after each invalidation. |
372 is_suitable_for_gpu_rasterization_ &= | 372 is_suitable_for_gpu_rasterization_ &= |
373 picture->IsSuitableForGpuRasterization(); | 373 picture->IsSuitableForGpuRasterization(); |
| 374 has_text_ |= picture->HasText(); |
374 base::TimeDelta duration = | 375 base::TimeDelta duration = |
375 stats_instrumentation->EndRecording(start_time); | 376 stats_instrumentation->EndRecording(start_time); |
376 best_duration = std::min(duration, best_duration); | 377 best_duration = std::min(duration, best_duration); |
377 } | 378 } |
378 int recorded_pixel_count = | 379 int recorded_pixel_count = |
379 picture->LayerRect().width() * picture->LayerRect().height(); | 380 picture->LayerRect().width() * picture->LayerRect().height(); |
380 stats_instrumentation->AddRecord(best_duration, recorded_pixel_count); | 381 stats_instrumentation->AddRecord(best_duration, recorded_pixel_count); |
381 } | 382 } |
382 | 383 |
383 bool found_tile_for_recorded_picture = false; | 384 bool found_tile_for_recorded_picture = false; |
(...skipping 18 matching lines...) Expand all Loading... |
402 } | 403 } |
403 | 404 |
404 void PicturePile::SetEmptyBounds() { | 405 void PicturePile::SetEmptyBounds() { |
405 tiling_.SetTilingSize(gfx::Size()); | 406 tiling_.SetTilingSize(gfx::Size()); |
406 picture_map_.clear(); | 407 picture_map_.clear(); |
407 has_any_recordings_ = false; | 408 has_any_recordings_ = false; |
408 recorded_viewport_ = gfx::Rect(); | 409 recorded_viewport_ = gfx::Rect(); |
409 } | 410 } |
410 | 411 |
411 } // namespace cc | 412 } // namespace cc |
OLD | NEW |