| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkRecording.h" | 8 #include "SkRecording.h" |
| 9 | 9 |
| 10 #include "SkRecord.h" | 10 #include "SkRecord.h" |
| 11 #include "SkRecordCulling.h" |
| 12 #include "SkRecordDraw.h" |
| 11 #include "SkRecorder.h" | 13 #include "SkRecorder.h" |
| 12 #include "SkRecordDraw.h" | |
| 13 | 14 |
| 14 namespace EXPERIMENTAL { | 15 namespace EXPERIMENTAL { |
| 15 | 16 |
| 16 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {} | 17 SkPlayback::SkPlayback(const SkRecord* record) : fRecord(record) {} |
| 17 | 18 |
| 18 SkPlayback::~SkPlayback() { | 19 SkPlayback::~SkPlayback() { |
| 19 SkDELETE(fRecord); | 20 SkDELETE(fRecord); |
| 20 } | 21 } |
| 21 | 22 |
| 22 void SkPlayback::draw(SkCanvas* canvas) const { | 23 void SkPlayback::draw(SkCanvas* canvas) const { |
| 23 SkASSERT(fRecord != NULL); | 24 SkASSERT(fRecord != NULL); |
| 24 SkRecordDraw(*fRecord, canvas); | 25 SkRecordDraw(*fRecord, canvas); |
| 25 } | 26 } |
| 26 | 27 |
| 27 /*static*/ SkRecording* SkRecording::Create(int width, int height) { | 28 /*static*/ SkRecording* SkRecording::Create(int width, int height) { |
| 28 return SkNEW_ARGS(SkRecording, (width, height)); | 29 return SkNEW_ARGS(SkRecording, (width, height)); |
| 29 } | 30 } |
| 30 | 31 |
| 31 SkRecording::SkRecording(int width, int height) { | 32 SkRecording::SkRecording(int width, int height) { |
| 32 SkRecord* record = SkNEW(SkRecord); | 33 SkRecord* record = SkNEW(SkRecord); |
| 33 fRecorder = SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, record, wid
th, height)); | 34 fRecorder = SkNEW_ARGS(SkRecorder, (SkRecorder::kReadWrite_Mode, record, wid
th, height)); |
| 34 fRecord = record; | 35 fRecord = record; |
| 35 } | 36 } |
| 36 | 37 |
| 37 /*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) { | 38 /*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) { |
| 38 const SkRecord* record = recording->fRecord; | 39 SkRecord* record = recording->fRecord; |
| 40 SkRecordAnnotateCullingPairs(record); |
| 39 SkDELETE(recording); | 41 SkDELETE(recording); |
| 40 return SkNEW_ARGS(SkPlayback, (record)); | 42 return SkNEW_ARGS(SkPlayback, (record)); |
| 41 } | 43 } |
| 42 | 44 |
| 43 SkRecording::~SkRecording() { | 45 SkRecording::~SkRecording() { |
| 44 SkDELETE(fRecorder); | 46 SkDELETE(fRecorder); |
| 45 } | 47 } |
| 46 | 48 |
| 47 SkCanvas* SkRecording::canvas() { | 49 SkCanvas* SkRecording::canvas() { |
| 48 return fRecorder; | 50 return fRecorder; |
| 49 } | 51 } |
| 50 | 52 |
| 51 } // namespace EXPERIMENTAL | 53 } // namespace EXPERIMENTAL |
| OLD | NEW |