| Index: include/core/SkShader.h
|
| diff --git a/include/core/SkShader.h b/include/core/SkShader.h
|
| index 28329be4aae211637bf31f51dc7a9e18612a4a50..76b86a6cfe9d9eee4281e855f44f671a332daf45 100644
|
| --- a/include/core/SkShader.h
|
| +++ b/include/core/SkShader.h
|
| @@ -223,15 +223,42 @@
|
| return (flags & kHasSpan16_Flag) != 0;
|
| }
|
|
|
| - /**
|
| - * Returns true if this shader is just a bitmap, and if not null, returns the bitmap,
|
| - * localMatrix, and tilemodes. If this is not a bitmap, returns false and ignores the
|
| - * out-parameters.
|
| - */
|
| - bool isABitmap(SkBitmap* outTexture, SkMatrix* outMatrix, TileMode xy[2]) const {
|
| - return this->onIsABitmap(outTexture, outMatrix, xy);
|
| +#ifdef SK_SUPPORT_LEGACY_SHADERBITMAPTYPE
|
| +public:
|
| +#else
|
| +protected:
|
| +#endif
|
| + /**
|
| + Gives method bitmap should be read to implement a shader.
|
| + Also determines number and interpretation of "extra" parameters returned
|
| + by asABitmap
|
| + */
|
| + enum BitmapType {
|
| + kNone_BitmapType, //<! Shader is not represented as a bitmap
|
| + kDefault_BitmapType,//<! Access bitmap using local coords transformed
|
| + };
|
| + /** Optional methods for shaders that can pretend to be a bitmap/texture
|
| + to play along with opengl. Default just returns kNone_BitmapType and
|
| + ignores the out parameters.
|
| +
|
| + @param outTexture if non-NULL will be the bitmap representing the shader
|
| + after return.
|
| + @param outMatrix if non-NULL will be the matrix to apply to vertices
|
| + to access the bitmap after return.
|
| + @param xy if non-NULL will be the tile modes that should be
|
| + used to access the bitmap after return.
|
| + @param twoPointRadialParams Two extra return values needed for two point
|
| + radial bitmaps. The first is the x-offset of
|
| + the second point and the second is the radius
|
| + about the first point.
|
| + */
|
| + virtual BitmapType asABitmap(SkBitmap* outTexture, SkMatrix* outMatrix,
|
| + TileMode xy[2]) const;
|
| +
|
| +public:
|
| + bool isABitmap(SkBitmap* bitmap, SkMatrix* matrix, TileMode xy[2]) const {
|
| + return this->asABitmap(bitmap, matrix, xy) == kDefault_BitmapType;
|
| }
|
| -
|
| bool isABitmap() const {
|
| return this->isABitmap(nullptr, nullptr, nullptr);
|
| }
|
| @@ -425,11 +452,6 @@
|
| virtual bool onAsLuminanceColor(SkColor*) const {
|
| return false;
|
| }
|
| -
|
| - virtual bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode[2]) const {
|
| - return false;
|
| - }
|
| -
|
| private:
|
| // This is essentially const, but not officially so it can be modified in
|
| // constructors.
|
|
|