OLD | NEW |
---|---|
(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 | |
OLD | NEW |