OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkShader_DEFINED | 8 #ifndef SkShader_DEFINED |
9 #define SkShader_DEFINED | 9 #define SkShader_DEFINED |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 /** | 115 /** |
116 * Called sometimes before drawing with this shader. Return the type of | 116 * Called sometimes before drawing with this shader. Return the type of |
117 * alpha your shader will return. The default implementation returns 0. | 117 * alpha your shader will return. The default implementation returns 0. |
118 * Your subclass should override if it can (even sometimes) report a | 118 * Your subclass should override if it can (even sometimes) report a |
119 * non-zero value, since that will enable various blitters to perform | 119 * non-zero value, since that will enable various blitters to perform |
120 * faster. | 120 * faster. |
121 */ | 121 */ |
122 virtual uint32_t getFlags() const { return 0; } | 122 virtual uint32_t getFlags() const { return 0; } |
123 | 123 |
| 124 bool supports4f() const { |
| 125 return SkToBool(this->getFlags() & kSupports4f_Flag); |
| 126 } |
| 127 |
124 /** | 128 /** |
125 * Called for each span of the object being drawn. Your subclass should | 129 * Called for each span of the object being drawn. Your subclass should |
126 * set the appropriate colors (with premultiplied alpha) that correspon
d | 130 * set the appropriate colors (with premultiplied alpha) that correspon
d |
127 * to the specified device coordinates. | 131 * to the specified device coordinates. |
128 */ | 132 */ |
129 virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0; | 133 virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0; |
130 | 134 |
131 virtual void shadeSpan4f(int x, int y, SkPM4f[], int count); | 135 virtual void shadeSpan4f(int x, int y, SkPM4f[], int count); |
132 | 136 |
133 /** | 137 /** |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 SkMatrix fLocalMatrix; | 414 SkMatrix fLocalMatrix; |
411 | 415 |
412 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 416 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
413 friend class SkLocalMatrixShader; | 417 friend class SkLocalMatrixShader; |
414 friend class SkBitmapProcShader; // for computeTotalInverse() | 418 friend class SkBitmapProcShader; // for computeTotalInverse() |
415 | 419 |
416 typedef SkFlattenable INHERITED; | 420 typedef SkFlattenable INHERITED; |
417 }; | 421 }; |
418 | 422 |
419 #endif | 423 #endif |
OLD | NEW |