OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkRemote_DEFINED | 8 #ifndef SkRemote_DEFINED |
9 #define SkRemote_DEFINED | 9 #define SkRemote_DEFINED |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 virtual ID define(SkXfermode*) = 0; | 74 virtual ID define(SkXfermode*) = 0; |
75 virtual ID define(SkMaskFilter*) = 0; | 75 virtual ID define(SkMaskFilter*) = 0; |
76 virtual ID define(SkColorFilter*) = 0; | 76 virtual ID define(SkColorFilter*) = 0; |
77 virtual ID define(SkRasterizer*) = 0; | 77 virtual ID define(SkRasterizer*) = 0; |
78 virtual ID define(SkDrawLooper*) = 0; | 78 virtual ID define(SkDrawLooper*) = 0; |
79 virtual ID define(SkImageFilter*) = 0; | 79 virtual ID define(SkImageFilter*) = 0; |
80 virtual ID define(SkAnnotation*) = 0; | 80 virtual ID define(SkAnnotation*) = 0; |
81 | 81 |
82 virtual void undefine(ID) = 0; | 82 virtual void undefine(ID) = 0; |
83 | 83 |
84 virtual void save() = 0; | |
85 virtual void restore() = 0; | |
86 | |
87 virtual void setMatrix(ID matrix) = 0; | |
88 | |
89 // TODO: do these all belong here in CommonIDs? | 84 // TODO: do these all belong here in CommonIDs? |
90 struct CommonIDs { | 85 struct CommonIDs { |
91 ID misc, patheffect, shader, xfermode, maskfilter, | 86 ID misc, patheffect, shader, xfermode, maskfilter, |
92 colorfilter, rasterizer, looper, imagefilter, annotation; | 87 colorfilter, rasterizer, looper, imagefilter, annotation; |
93 }; | 88 }; |
94 | 89 |
| 90 virtual void save() = 0; |
| 91 virtual void restore() = 0; |
| 92 virtual void saveLayer(ID bounds, CommonIDs, SkCanvas::SaveFlags) = 0; |
| 93 |
| 94 virtual void setMatrix(ID matrix) = 0; |
| 95 |
95 virtual void clipPath(ID path, SkRegion::Op, bool aa) = 0; | 96 virtual void clipPath(ID path, SkRegion::Op, bool aa) = 0; |
96 virtual void fillPath(ID path, CommonIDs) = 0; | 97 virtual void fillPath(ID path, CommonIDs) = 0; |
97 virtual void strokePath(ID path, CommonIDs, ID stroke) = 0; | 98 virtual void strokePath(ID path, CommonIDs, ID stroke) = 0; |
98 }; | 99 }; |
99 | 100 |
100 // None of these factories take ownership of their arguments. | 101 // None of these factories take ownership of their arguments. |
101 | 102 |
102 // Returns a new SkCanvas that translates to the Encoder API. | 103 // Returns a new SkCanvas that translates to the Encoder API. |
103 SkCanvas* NewCanvas(Encoder*); | 104 SkCanvas* NewCanvas(Encoder*); |
104 // Returns an Encoder that translates back to the SkCanvas API. | 105 // Returns an Encoder that translates back to the SkCanvas API. |
105 Encoder* NewDecoder(SkCanvas*); | 106 Encoder* NewDecoder(SkCanvas*); |
106 // Wraps another Encoder with a cache. TODO: parameterize | 107 // Wraps another Encoder with a cache. TODO: parameterize |
107 Encoder* NewCachingEncoder(Encoder*); | 108 Encoder* NewCachingEncoder(Encoder*); |
108 | 109 |
109 } // namespace SkRemote | 110 } // namespace SkRemote |
110 | 111 |
111 #endif//SkRemote_DEFINED | 112 #endif//SkRemote_DEFINED |
OLD | NEW |