| 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/histograms.h" | 9 #include "cc/base/histograms.h" |
| 10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 int repeat_count = 1; | 113 int repeat_count = 1; |
| 114 if (slow_down_raster_scale_factor_for_debug_ > 1) { | 114 if (slow_down_raster_scale_factor_for_debug_ > 1) { |
| 115 repeat_count = slow_down_raster_scale_factor_for_debug_; | 115 repeat_count = slow_down_raster_scale_factor_for_debug_; |
| 116 if (painting_control != | 116 if (painting_control != |
| 117 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { | 117 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { |
| 118 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; | 118 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 for (int i = 0; i < repeat_count; ++i) { | 121 for (int i = 0; i < repeat_count; ++i) { |
| 122 const bool use_cached_picture = true; | 122 display_list_ = painter->PaintContentsToDisplayList(recorded_viewport_, |
| 123 display_list_ = | 123 painting_control); |
| 124 DisplayItemList::Create(recorded_viewport_, use_cached_picture); | |
| 125 painter->PaintContentsToDisplayList(display_list_.get(), recorded_viewport_, | |
| 126 painting_control); | |
| 127 } | 124 } |
| 128 display_list_->CreateAndCacheSkPicture(); | 125 display_list_->set_layer_rect(recorded_viewport_); |
| 129 | |
| 130 is_suitable_for_gpu_rasterization_ = | 126 is_suitable_for_gpu_rasterization_ = |
| 131 display_list_->IsSuitableForGpuRasterization(); | 127 display_list_->IsSuitableForGpuRasterization(); |
| 128 |
| 132 DetermineIfSolidColor(); | 129 DetermineIfSolidColor(); |
| 133 display_list_->EmitTraceSnapshot(); | 130 display_list_->EmitTraceSnapshot(); |
| 131 |
| 132 display_list_->CreateAndCacheSkPicture(); |
| 134 if (gather_pixel_refs_) | 133 if (gather_pixel_refs_) |
| 135 display_list_->GatherPixelRefs(grid_cell_size_); | 134 display_list_->GatherPixelRefs(grid_cell_size_); |
| 136 | 135 |
| 137 return true; | 136 return true; |
| 138 } | 137 } |
| 139 | 138 |
| 140 gfx::Size DisplayListRecordingSource::GetSize() const { | 139 gfx::Size DisplayListRecordingSource::GetSize() const { |
| 141 return size_; | 140 return size_; |
| 142 } | 141 } |
| 143 | 142 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 194 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 196 } | 195 } |
| 197 | 196 |
| 198 void DisplayListRecordingSource::Clear() { | 197 void DisplayListRecordingSource::Clear() { |
| 199 recorded_viewport_ = gfx::Rect(); | 198 recorded_viewport_ = gfx::Rect(); |
| 200 display_list_ = NULL; | 199 display_list_ = NULL; |
| 201 is_solid_color_ = false; | 200 is_solid_color_ = false; |
| 202 } | 201 } |
| 203 | 202 |
| 204 } // namespace cc | 203 } // namespace cc |
| OLD | NEW |