Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: cc/resources/display_list_recording_source.cc

Issue 1077033004: cc: Make DisplayItemList::Append replay into an SkPicture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 display_list_ = painter->PaintContentsToDisplayList(recorded_viewport_,
110 painting_control); 110 painting_control);
111 } 111 }
112 display_list_->set_layer_rect(recorded_viewport_); 112 display_list_->CreateAndCacheSkPicture();
113
113 is_suitable_for_gpu_rasterization_ = 114 is_suitable_for_gpu_rasterization_ =
114 display_list_->IsSuitableForGpuRasterization(); 115 display_list_->IsSuitableForGpuRasterization();
115
116 DetermineIfSolidColor(); 116 DetermineIfSolidColor();
117 display_list_->EmitTraceSnapshot(); 117 display_list_->EmitTraceSnapshot();
118
119 display_list_->CreateAndCacheSkPicture();
120 if (gather_pixel_refs_) 118 if (gather_pixel_refs_)
121 display_list_->GatherPixelRefs(grid_cell_size_); 119 display_list_->GatherPixelRefs(grid_cell_size_);
122 120
123 return true; 121 return true;
124 } 122 }
125 123
126 gfx::Size DisplayListRecordingSource::GetSize() const { 124 gfx::Size DisplayListRecordingSource::GetSize() const {
127 return size_; 125 return size_;
128 } 126 }
129 127
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); 179 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_);
182 } 180 }
183 181
184 void DisplayListRecordingSource::Clear() { 182 void DisplayListRecordingSource::Clear() {
185 recorded_viewport_ = gfx::Rect(); 183 recorded_viewport_ = gfx::Rect();
186 display_list_ = NULL; 184 display_list_ = NULL;
187 is_solid_color_ = false; 185 is_solid_color_ = false;
188 } 186 }
189 187
190 } // namespace cc 188 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698