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 |
11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
12 #include "SkRecord.h" | 12 #include "SkRecord.h" |
13 #include "SkRecords.h" | 13 #include "SkRecords.h" |
14 #include "SkTDArray.h" | 14 #include "SkTDArray.h" |
15 | 15 |
16 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. | 16 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. |
17 | 17 |
18 class SkRecorder : public SkCanvas { | 18 class SkRecorder : public SkCanvas { |
19 public: | 19 public: |
20 // Does not take ownership of the SkRecord. | 20 // Does not take ownership of the SkRecord. |
21 SkRecorder(SkRecord*, int width, int height); | 21 SkRecorder(SkRecord*, int width, int height); // legacy version |
| 22 SkRecorder(SkRecord*, const SkRect& bounds); |
22 virtual ~SkRecorder() SK_OVERRIDE; | 23 virtual ~SkRecorder() SK_OVERRIDE; |
23 | 24 |
24 // return a (new or ref'd) data containing the array of pictures that were | 25 // return a (new or ref'd) data containing the array of pictures that were |
25 // snapped from our drawables. | 26 // snapped from our drawables. |
26 SkData* newDrawableSnapshot(SkBBHFactory*, uint32_t recordFlags); | 27 SkData* newDrawableSnapshot(SkBBHFactory*, uint32_t recordFlags); |
27 | 28 |
28 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 29 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
29 void forgetRecord(); | 30 void forgetRecord(); |
30 | 31 |
31 void clear(SkColor) SK_OVERRIDE; | 32 void clear(SkColor) SK_OVERRIDE; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 143 } |
143 | 144 |
144 SkRecord* fRecord; | 145 SkRecord* fRecord; |
145 | 146 |
146 int fSaveLayerCount; | 147 int fSaveLayerCount; |
147 SkTDArray<SkBool8> fSaveIsSaveLayer; | 148 SkTDArray<SkBool8> fSaveIsSaveLayer; |
148 SkTDArray<SkCanvasDrawable*> fDrawableList; | 149 SkTDArray<SkCanvasDrawable*> fDrawableList; |
149 }; | 150 }; |
150 | 151 |
151 #endif//SkRecorder_DEFINED | 152 #endif//SkRecorder_DEFINED |
OLD | NEW |