| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 for (const auto& record_rect : record_rects) { | 538 for (const auto& record_rect : record_rects) { |
| 539 gfx::Rect padded_record_rect = PadRect(record_rect); | 539 gfx::Rect padded_record_rect = PadRect(record_rect); |
| 540 | 540 |
| 541 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); | 541 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); |
| 542 scoped_refptr<Picture> picture; | 542 scoped_refptr<Picture> picture; |
| 543 | 543 |
| 544 // Note: Currently, gathering of pixel refs when using a single | 544 // Note: Currently, gathering of pixel refs when using a single |
| 545 // raster thread doesn't provide any benefit. This might change | 545 // raster thread doesn't provide any benefit. This might change |
| 546 // in the future but we avoid it for now to reduce the cost of | 546 // in the future but we avoid it for now to reduce the cost of |
| 547 // Picture::Create. | 547 // Picture::Create. |
| 548 bool gather_pixel_refs = RasterWorkerPool::GetNumRasterThreads() > 1; | 548 bool gather_pixel_refs = TileTaskWorkerPool::GetNumRasterThreads() > 1; |
| 549 | 549 |
| 550 for (int i = 0; i < repeat_count; i++) { | 550 for (int i = 0; i < repeat_count; i++) { |
| 551 picture = Picture::Create(padded_record_rect, painter, tile_grid_info_, | 551 picture = Picture::Create(padded_record_rect, painter, tile_grid_info_, |
| 552 gather_pixel_refs, recording_mode); | 552 gather_pixel_refs, recording_mode); |
| 553 // Note the '&&' with previous is-suitable state. | 553 // Note the '&&' with previous is-suitable state. |
| 554 // This means that once a picture-pile becomes unsuitable for gpu | 554 // This means that once a picture-pile becomes unsuitable for gpu |
| 555 // rasterization due to some content, it will continue to be unsuitable | 555 // rasterization due to some content, it will continue to be unsuitable |
| 556 // even if that content is replaced by gpu-friendly content. | 556 // even if that content is replaced by gpu-friendly content. |
| 557 // This is an optimization to avoid iterating though all pictures in | 557 // This is an optimization to avoid iterating though all pictures in |
| 558 // the pile after each invalidation. | 558 // the pile after each invalidation. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 const Picture* PicturePile::PictureInfo::GetPicture() const { | 771 const Picture* PicturePile::PictureInfo::GetPicture() const { |
| 772 return picture_.get(); | 772 return picture_.get(); |
| 773 } | 773 } |
| 774 | 774 |
| 775 float PicturePile::PictureInfo::GetInvalidationFrequency() const { | 775 float PicturePile::PictureInfo::GetInvalidationFrequency() const { |
| 776 return invalidation_history_.count() / | 776 return invalidation_history_.count() / |
| 777 static_cast<float>(INVALIDATION_FRAMES_TRACKED); | 777 static_cast<float>(INVALIDATION_FRAMES_TRACKED); |
| 778 } | 778 } |
| 779 | 779 |
| 780 } // namespace cc | 780 } // namespace cc |
| OLD | NEW |