| 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 #ifndef SkRecorder_DEFINED | 8 #ifndef SkRecorder_DEFINED |
| 9 #define SkRecorder_DEFINED | 9 #define SkRecorder_DEFINED |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. | 34 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. |
| 35 | 35 |
| 36 class SkRecorder : public SkCanvas { | 36 class SkRecorder : public SkCanvas { |
| 37 public: | 37 public: |
| 38 // Does not take ownership of the SkRecord. | 38 // Does not take ownership of the SkRecord. |
| 39 SkRecorder(SkRecord*, int width, int height); // legacy version | 39 SkRecorder(SkRecord*, int width, int height); // legacy version |
| 40 SkRecorder(SkRecord*, const SkRect& bounds); | 40 SkRecorder(SkRecord*, const SkRect& bounds); |
| 41 | 41 |
| 42 void reset(SkRecord*, const SkRect& bounds); | |
| 43 | |
| 44 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } | 42 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } |
| 45 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } | 43 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } |
| 46 | 44 |
| 47 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 45 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
| 48 void forgetRecord(); | 46 void forgetRecord(); |
| 49 | 47 |
| 50 void willSave() override; | 48 void willSave() override; |
| 51 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; | 49 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; |
| 52 void willRestore() override {} | 50 void willRestore() override {} |
| 53 void didRestore() override; | 51 void didRestore() override; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 this->getClipDeviceBounds(&devBounds); | 128 this->getClipDeviceBounds(&devBounds); |
| 131 return devBounds; | 129 return devBounds; |
| 132 } | 130 } |
| 133 | 131 |
| 134 SkRecord* fRecord; | 132 SkRecord* fRecord; |
| 135 | 133 |
| 136 SkAutoTDelete<SkDrawableList> fDrawableList; | 134 SkAutoTDelete<SkDrawableList> fDrawableList; |
| 137 }; | 135 }; |
| 138 | 136 |
| 139 #endif//SkRecorder_DEFINED | 137 #endif//SkRecorder_DEFINED |
| OLD | NEW |