| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // TODO: document | 64 // TODO: document |
| 65 struct Encoder { | 65 struct Encoder { |
| 66 virtual ~Encoder() {} | 66 virtual ~Encoder() {} |
| 67 | 67 |
| 68 virtual ID define(const SkMatrix&) = 0; | 68 virtual ID define(const SkMatrix&) = 0; |
| 69 virtual ID define(const Misc&) = 0; | 69 virtual ID define(const Misc&) = 0; |
| 70 virtual ID define(const SkPath&) = 0; | 70 virtual ID define(const SkPath&) = 0; |
| 71 virtual ID define(const Stroke&) = 0; | 71 virtual ID define(const Stroke&) = 0; |
| 72 virtual ID define(SkPathEffect*) = 0; |
| 72 virtual ID define(SkShader*) = 0; | 73 virtual ID define(SkShader*) = 0; |
| 73 virtual ID define(SkXfermode*) = 0; | 74 virtual ID define(SkXfermode*) = 0; |
| 75 virtual ID define(SkMaskFilter*) = 0; |
| 76 virtual ID define(SkColorFilter*) = 0; |
| 77 virtual ID define(SkRasterizer*) = 0; |
| 78 virtual ID define(SkDrawLooper*) = 0; |
| 79 virtual ID define(SkImageFilter*) = 0; |
| 80 virtual ID define(SkAnnotation*) = 0; |
| 74 | 81 |
| 75 virtual void undefine(ID) = 0; | 82 virtual void undefine(ID) = 0; |
| 76 | 83 |
| 77 virtual void save() = 0; | 84 virtual void save() = 0; |
| 78 virtual void restore() = 0; | 85 virtual void restore() = 0; |
| 79 | 86 |
| 80 virtual void setMatrix(ID matrix) = 0; | 87 virtual void setMatrix(ID matrix) = 0; |
| 81 | 88 |
| 82 // TODO: struct CommonIDs { ID misc, shader, xfermode; ... } | 89 // TODO: do these all belong here in CommonIDs? |
| 83 // for IDs that affect both fill + stroke? | 90 struct CommonIDs { |
| 91 ID misc, patheffect, shader, xfermode, maskfilter, |
| 92 colorfilter, rasterizer, looper, imagefilter, annotation; |
| 93 }; |
| 84 | 94 |
| 85 virtual void clipPath(ID path, SkRegion::Op, bool aa)
= 0; | 95 virtual void clipPath(ID path, SkRegion::Op, bool aa) = 0; |
| 86 virtual void fillPath(ID path, ID misc, ID shader, ID xfermode)
= 0; | 96 virtual void fillPath(ID path, CommonIDs) = 0; |
| 87 virtual void strokePath(ID path, ID misc, ID shader, ID xfermode, ID str
oke) = 0; | 97 virtual void strokePath(ID path, CommonIDs, ID stroke) = 0; |
| 88 }; | 98 }; |
| 89 | 99 |
| 90 // None of these factories take ownership of their arguments. | 100 // None of these factories take ownership of their arguments. |
| 91 | 101 |
| 92 // Returns a new SkCanvas that translates to the Encoder API. | 102 // Returns a new SkCanvas that translates to the Encoder API. |
| 93 SkCanvas* NewCanvas(Encoder*); | 103 SkCanvas* NewCanvas(Encoder*); |
| 94 // Returns an Encoder that translates back to the SkCanvas API. | 104 // Returns an Encoder that translates back to the SkCanvas API. |
| 95 Encoder* NewDecoder(SkCanvas*); | 105 Encoder* NewDecoder(SkCanvas*); |
| 96 // Wraps another Encoder with a cache. TODO: parameterize | 106 // Wraps another Encoder with a cache. TODO: parameterize |
| 97 Encoder* NewCachingEncoder(Encoder*); | 107 Encoder* NewCachingEncoder(Encoder*); |
| 98 | 108 |
| 99 } // namespace SkRemote | 109 } // namespace SkRemote |
| 100 | 110 |
| 101 #endif//SkRemote_DEFINED | 111 #endif//SkRemote_DEFINED |
| OLD | NEW |