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

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

Issue 737943002: Update from https://crrev.com/304715 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/resources/gpu_raster_worker_pool.cc ('k') | cc/resources/picture_layer_tiling_set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "cc/resources/picture.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 TRACE_EVENT2("cc", 203 TRACE_EVENT2("cc",
204 "Picture::Record", 204 "Picture::Record",
205 "data", 205 "data",
206 AsTraceableRecordData(), 206 AsTraceableRecordData(),
207 "recording_mode", 207 "recording_mode",
208 recording_mode); 208 recording_mode);
209 209
210 DCHECK(!picture_); 210 DCHECK(!picture_);
211 DCHECK(!tile_grid_info.fTileInterval.isEmpty()); 211 DCHECK(!tile_grid_info.fTileInterval.isEmpty());
212 212
213 SkTileGridFactory factory(tile_grid_info); 213 // TODO(mtklein): If SkRTree sticks, clean up tile_grid_info. skbug.com/3085
214 SkRTreeFactory factory;
214 SkPictureRecorder recorder; 215 SkPictureRecorder recorder;
215 216
216 skia::RefPtr<SkCanvas> canvas; 217 skia::RefPtr<SkCanvas> canvas;
217 canvas = skia::SharePtr(recorder.beginRecording( 218 canvas = skia::SharePtr(recorder.beginRecording(
218 layer_rect_.width(), layer_rect_.height(), &factory)); 219 layer_rect_.width(), layer_rect_.height(), &factory,
220 SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag));
219 221
220 ContentLayerClient::GraphicsContextStatus graphics_context_status = 222 ContentLayerClient::GraphicsContextStatus graphics_context_status =
221 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED; 223 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED;
222 224
223 switch (recording_mode) { 225 switch (recording_mode) {
224 case RECORD_NORMALLY: 226 case RECORD_NORMALLY:
225 // Already setup for normal recording. 227 // Already setup for normal recording.
226 break; 228 break;
227 case RECORD_WITH_SK_NULL_CANVAS: 229 case RECORD_WITH_SK_NULL_CANVAS:
228 canvas = skia::AdoptRef(SkCreateNullCanvas()); 230 canvas = skia::AdoptRef(SkCreateNullCanvas());
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 scoped_refptr<base::debug::TracedValue> record_data = 513 scoped_refptr<base::debug::TracedValue> record_data =
512 new base::debug::TracedValue(); 514 new base::debug::TracedValue();
513 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); 515 TracedValue::SetIDRef(this, record_data.get(), "picture_id");
514 record_data->BeginArray("layer_rect"); 516 record_data->BeginArray("layer_rect");
515 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); 517 MathUtil::AddToTracedValue(layer_rect_, record_data.get());
516 record_data->EndArray(); 518 record_data->EndArray();
517 return record_data; 519 return record_data;
518 } 520 }
519 521
520 } // namespace cc 522 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/gpu_raster_worker_pool.cc ('k') | cc/resources/picture_layer_tiling_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698