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

Side by Side Diff: src/record/SkRecording.cpp

Issue 233053005: Add a focused public API for src/record. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: wrap in EXPERIMENTAL Created 6 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
(Empty)
1 #include "SkRecording.h"
robertphillips 2014/04/11 13:28:08 Header?
2
3 #include "SkRecord.h"
4 #include "SkRecorder.h"
5 #include "SkRecordDraw.h"
6
7 namespace EXPERIMENTAL {
8
9 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {}
10
11 SkPlayback::~SkPlayback() {
12 SkDELETE(fRecord);
13 }
14
15 void SkPlayback::draw(SkCanvas* canvas) const {
16 SkASSERT(fRecord != NULL);
17 SkRecordDraw(*fRecord, canvas);
18 }
19
20 /*static*/ SkRecording* SkRecording::Create(int width, int height) {
21 return SkNEW_ARGS(SkRecording, (width, height));
22 }
23
24 SkRecording::SkRecording(int width, int height) {
25 SkRecord* record = SkNEW(SkRecord);
26 fRecorder = SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, record, wid th, height));
27 fRecord = record;
28 }
29
30 /*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) {
31 const SkRecord* record = recording->fRecord;
32 SkDELETE(recording);
33 return SkNEW_ARGS(SkPlayback, (record));
34 }
35
36 SkRecording::~SkRecording() {
37 SkDELETE(fRecorder);
38 }
39
40 SkCanvas* SkRecording::canvas() {
41 return fRecorder;
42 }
43
44 } // namespace EXPERIMENTAL
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698