| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display_list_recording_source.h" | 5 #include "cc/resources/display_list_recording_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 int repeat_count = 1; | 100 int repeat_count = 1; |
| 101 if (slow_down_raster_scale_factor_for_debug_ > 1) { | 101 if (slow_down_raster_scale_factor_for_debug_ > 1) { |
| 102 repeat_count = slow_down_raster_scale_factor_for_debug_; | 102 repeat_count = slow_down_raster_scale_factor_for_debug_; |
| 103 if (painting_control != | 103 if (painting_control != |
| 104 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { | 104 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { |
| 105 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; | 105 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 for (int i = 0; i < repeat_count; ++i) { | 108 for (int i = 0; i < repeat_count; ++i) { |
| 109 display_list_ = painter->PaintContentsToDisplayList(recorded_viewport_, | 109 const bool use_cached_picture = true; |
| 110 painting_control); | 110 display_list_ = |
| 111 DisplayItemList::Create(recorded_viewport_, use_cached_picture); |
| 112 painter->PaintContentsToDisplayList(display_list_.get(), recorded_viewport_, |
| 113 painting_control); |
| 111 } | 114 } |
| 112 display_list_->set_layer_rect(recorded_viewport_); | 115 display_list_->CreateAndCacheSkPicture(); |
| 116 |
| 113 is_suitable_for_gpu_rasterization_ = | 117 is_suitable_for_gpu_rasterization_ = |
| 114 display_list_->IsSuitableForGpuRasterization(); | 118 display_list_->IsSuitableForGpuRasterization(); |
| 115 | |
| 116 DetermineIfSolidColor(); | 119 DetermineIfSolidColor(); |
| 117 display_list_->EmitTraceSnapshot(); | 120 display_list_->EmitTraceSnapshot(); |
| 118 | |
| 119 display_list_->CreateAndCacheSkPicture(); | |
| 120 if (gather_pixel_refs_) | 121 if (gather_pixel_refs_) |
| 121 display_list_->GatherPixelRefs(grid_cell_size_); | 122 display_list_->GatherPixelRefs(grid_cell_size_); |
| 122 | 123 |
| 123 return true; | 124 return true; |
| 124 } | 125 } |
| 125 | 126 |
| 126 gfx::Size DisplayListRecordingSource::GetSize() const { | 127 gfx::Size DisplayListRecordingSource::GetSize() const { |
| 127 return size_; | 128 return size_; |
| 128 } | 129 } |
| 129 | 130 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 182 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 182 } | 183 } |
| 183 | 184 |
| 184 void DisplayListRecordingSource::Clear() { | 185 void DisplayListRecordingSource::Clear() { |
| 185 recorded_viewport_ = gfx::Rect(); | 186 recorded_viewport_ = gfx::Rect(); |
| 186 display_list_ = NULL; | 187 display_list_ = NULL; |
| 187 is_solid_color_ = false; | 188 is_solid_color_ = false; |
| 188 } | 189 } |
| 189 | 190 |
| 190 } // namespace cc | 191 } // namespace cc |
| OLD | NEW |