| 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 |
| 42 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } | 44 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } |
| 43 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } | 45 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } |
| 44 | 46 |
| 45 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 47 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
| 46 void forgetRecord(); | 48 void forgetRecord(); |
| 47 | 49 |
| 48 void willSave() override; | 50 void willSave() override; |
| 49 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; | 51 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; |
| 50 void willRestore() override {} | 52 void willRestore() override {} |
| 51 void didRestore() override; | 53 void didRestore() override; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 this->getClipDeviceBounds(&devBounds); | 130 this->getClipDeviceBounds(&devBounds); |
| 129 return devBounds; | 131 return devBounds; |
| 130 } | 132 } |
| 131 | 133 |
| 132 SkRecord* fRecord; | 134 SkRecord* fRecord; |
| 133 | 135 |
| 134 SkAutoTDelete<SkDrawableList> fDrawableList; | 136 SkAutoTDelete<SkDrawableList> fDrawableList; |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 #endif//SkRecorder_DEFINED | 139 #endif//SkRecorder_DEFINED |
| OLD | NEW |