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

Side by Side Diff: cc/paint/paint_recorder.cc

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: Rebase, move slow path counting Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/paint/paint_recorder.h" 5 #include "cc/paint/paint_recorder.h"
6 6
7 #include "cc/paint/paint_op_buffer.h"
8
7 namespace cc { 9 namespace cc {
8 10
9 PaintRecorder::PaintRecorder() = default; 11 PaintRecorder::PaintRecorder() = default;
12
10 PaintRecorder::~PaintRecorder() = default; 13 PaintRecorder::~PaintRecorder() = default;
11 14
15 PaintCanvas* PaintRecorder::beginRecording(const SkRect& bounds) {
16 buffer_.reset(new PaintOpBuffer(bounds));
17 canvas_.emplace(buffer_.get(), bounds);
18 return getRecordingCanvas();
19 }
20
21 sk_sp<PaintRecord> PaintRecorder::finishRecordingAsPicture() {
22 // Some users (e.g. printing) use the existence of the recording canvas
23 // to know if recording is finished, so reset it here.
24 canvas_.reset();
25 // TODO(enne): consider making a mini picture here.
vmpstr 2017/03/28 18:27:15 Do we still need this with the optimization in the
enne (OOO) 2017/03/28 19:28:05 Yeah, it's possible. I think I would consider mak
26 return std::move(buffer_);
27 }
28
12 } // namespace cc 29 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698