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 23 matching lines...) Expand all Loading... |
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); | 42 void reset(SkRecord*, const SkRect& bounds); |
43 | 43 |
| 44 size_t approxBytesUsedBySubPictures() const { return fApproxBytesUsedBySubPi
ctures; } |
| 45 |
44 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } | 46 SkDrawableList* getDrawableList() const { return fDrawableList.get(); } |
45 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } | 47 SkDrawableList* detachDrawableList() { return fDrawableList.detach(); } |
46 | 48 |
47 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 49 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
48 void forgetRecord(); | 50 void forgetRecord(); |
49 | 51 |
50 void willSave() override; | 52 void willSave() override; |
51 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; | 53 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags) override; |
52 void willRestore() override {} | 54 void willRestore() override {} |
53 void didRestore() override; | 55 void didRestore() override; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 126 |
125 template <typename T> | 127 template <typename T> |
126 T* copy(const T[], size_t count); | 128 T* copy(const T[], size_t count); |
127 | 129 |
128 SkIRect devBounds() const { | 130 SkIRect devBounds() const { |
129 SkIRect devBounds; | 131 SkIRect devBounds; |
130 this->getClipDeviceBounds(&devBounds); | 132 this->getClipDeviceBounds(&devBounds); |
131 return devBounds; | 133 return devBounds; |
132 } | 134 } |
133 | 135 |
| 136 size_t fApproxBytesUsedBySubPictures; |
134 SkRecord* fRecord; | 137 SkRecord* fRecord; |
135 | |
136 SkAutoTDelete<SkDrawableList> fDrawableList; | 138 SkAutoTDelete<SkDrawableList> fDrawableList; |
137 }; | 139 }; |
138 | 140 |
139 #endif//SkRecorder_DEFINED | 141 #endif//SkRecorder_DEFINED |
OLD | NEW |