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

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

Issue 1066273002: Use SkPictureRecorder::endRecordingAsPicture() instead of endRecording() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « cc/resources/gpu_rasterizer.cc ('k') | cc/resources/picture_pile_impl.cc » ('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 <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 canvas->save(); 212 canvas->save();
213 canvas->translate(SkFloatToScalar(-layer_rect_.x()), 213 canvas->translate(SkFloatToScalar(-layer_rect_.x()),
214 SkFloatToScalar(-layer_rect_.y())); 214 SkFloatToScalar(-layer_rect_.y()));
215 215
216 canvas->clipRect(gfx::RectToSkRect(layer_rect_)); 216 canvas->clipRect(gfx::RectToSkRect(layer_rect_));
217 217
218 painter->PaintContents(canvas.get(), layer_rect_, painting_control); 218 painter->PaintContents(canvas.get(), layer_rect_, painting_control);
219 219
220 canvas->restore(); 220 canvas->restore();
221 picture_ = skia::AdoptRef(recorder.endRecording()); 221 picture_ = skia::AdoptRef(recorder.endRecordingAsPicture());
222 DCHECK(picture_); 222 DCHECK(picture_);
223 223
224 EmitTraceSnapshot(); 224 EmitTraceSnapshot();
225 } 225 }
226 226
227 void Picture::GatherPixelRefs() { 227 void Picture::GatherPixelRefs() {
228 TRACE_EVENT2("cc", "Picture::GatherPixelRefs", 228 TRACE_EVENT2("cc", "Picture::GatherPixelRefs",
229 "width", layer_rect_.width(), 229 "width", layer_rect_.width(),
230 "height", layer_rect_.height()); 230 "height", layer_rect_.height());
231 231
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 scoped_refptr<base::trace_event::ConvertableToTraceFormat> 329 scoped_refptr<base::trace_event::ConvertableToTraceFormat>
330 Picture::AsTraceableRecordData() const { 330 Picture::AsTraceableRecordData() const {
331 scoped_refptr<base::trace_event::TracedValue> record_data = 331 scoped_refptr<base::trace_event::TracedValue> record_data =
332 new base::trace_event::TracedValue(); 332 new base::trace_event::TracedValue();
333 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); 333 TracedValue::SetIDRef(this, record_data.get(), "picture_id");
334 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get()); 334 MathUtil::AddToTracedValue("layer_rect", layer_rect_, record_data.get());
335 return record_data; 335 return record_data;
336 } 336 }
337 337
338 } // namespace cc 338 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/gpu_rasterizer.cc ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698