virtual void shadeSpan16(int x, int y, uint16_t span[], int count);
virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count);
- virtual BitmapType asABitmap(SkBitmap* outTexture,
+ virtual BitmapType asABitmap(SkBitmap* outTexture,
SkMatrix* outMatrix,
- TileMode xy[2],
- SkScalar* twoPointRadialParams);
+ TileMode xy[2],
+ SkScalar* twoPointRadialParams) const;
virtual GradientType asAGradient(GradientInfo* info) const;
virtual void flatten(SkFlattenableWriteBuffer& );
virtual Factory getFactory() { return CreateProc; }
private:
- static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
- return SkNEW_ARGS(SkColorShader, (buffer));
+ static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
+ return SkNEW_ARGS(SkColorShader, (buffer));
}
SkColor fColor; // ignored if fInheritColor is true
SkPMColor fPMColor; // cached after setContext()
SkBool8 fInheritColor;
// deferred allocation, used for asABitmap()
- SkPixelRef* fAsABitmapPixelRef;
+ mutable SkPixelRef* fAsABitmapPixelRef;
typedef SkShader INHERITED;
};
// if we had a asAColor method, that would be more efficient...
SkShader::BitmapType SkColorShader::asABitmap(SkBitmap* bitmap, SkMatrix* matrix,
TileMode modes[],
- SkScalar* twoPointRadialParams) {
+ SkScalar* twoPointRadialParams) const {
// we cache the pixelref, since its generateID is used in the texture cache
if (NULL == fAsABitmapPixelRef) {
SkPMColor* storage = (SkPMColor*)sk_malloc_throw(sizeof(SkPMColor));