| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 */ | 142 */ |
| 143 virtual uint8_t getSpan16Alpha() const { return fPaintAlpha; } | 143 virtual uint8_t getSpan16Alpha() const { return fPaintAlpha; } |
| 144 | 144 |
| 145 /** | 145 /** |
| 146 * Called for each span of the object being drawn. Your subclass should | 146 * Called for each span of the object being drawn. Your subclass should |
| 147 * set the appropriate colors (with premultiplied alpha) that correspon
d | 147 * set the appropriate colors (with premultiplied alpha) that correspon
d |
| 148 * to the specified device coordinates. | 148 * to the specified device coordinates. |
| 149 */ | 149 */ |
| 150 virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0; | 150 virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0; |
| 151 | 151 |
| 152 /** | 152 typedef void (*ShadeProc)(void* ctx, int x, int y, SkPMColor[], int coun
t); |
| 153 * The const void* ctx is only const because all the implementations are
const. | |
| 154 * This can be changed to non-const if a new shade proc needs to change
the ctx. | |
| 155 */ | |
| 156 typedef void (*ShadeProc)(const void* ctx, int x, int y, SkPMColor[], in
t count); | |
| 157 virtual ShadeProc asAShadeProc(void** ctx); | 153 virtual ShadeProc asAShadeProc(void** ctx); |
| 158 | 154 |
| 159 /** | 155 /** |
| 160 * Called only for 16bit devices when getFlags() returns | 156 * Called only for 16bit devices when getFlags() returns |
| 161 * kOpaqueAlphaFlag | kHasSpan16_Flag | 157 * kOpaqueAlphaFlag | kHasSpan16_Flag |
| 162 */ | 158 */ |
| 163 virtual void shadeSpan16(int x, int y, uint16_t[], int count); | 159 virtual void shadeSpan16(int x, int y, uint16_t[], int count); |
| 164 | 160 |
| 165 /** | 161 /** |
| 166 * Similar to shadeSpan, but only returns the alpha-channel for a span. | 162 * Similar to shadeSpan, but only returns the alpha-channel for a span. |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 SkMatrix fLocalMatrix; | 439 SkMatrix fLocalMatrix; |
| 444 | 440 |
| 445 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 441 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
| 446 friend class SkLocalMatrixShader; | 442 friend class SkLocalMatrixShader; |
| 447 friend class SkBitmapProcShader; // for computeTotalInverse() | 443 friend class SkBitmapProcShader; // for computeTotalInverse() |
| 448 | 444 |
| 449 typedef SkFlattenable INHERITED; | 445 typedef SkFlattenable INHERITED; |
| 450 }; | 446 }; |
| 451 | 447 |
| 452 #endif | 448 #endif |
| OLD | NEW |