epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2006 The Android Open Source Project |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 4 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 10 | #ifndef SkShader_DEFINED |
| 11 | #define SkShader_DEFINED |
| 12 | |
| 13 | #include "SkBitmap.h" |
| 14 | #include "SkFlattenable.h" |
| 15 | #include "SkMask.h" |
| 16 | #include "SkMatrix.h" |
| 17 | #include "SkPaint.h" |
| 18 | |
| 19 | class SkPath; |
| 20 | |
| 21 | /** \class SkShader |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 22 | * |
reed@google.com | 880dc47 | 2012-05-11 14:47:03 +0000 | [diff] [blame^] | 23 | * Shaders specify the source color(s) for what is being drawn. If a paint |
| 24 | * has no shader, then the paint's color is used. If the paint has a |
| 25 | * shader, then the shader's color(s) are use instead, but they are |
| 26 | * modulated by the paint's alpha. This makes it easy to create a shader |
| 27 | * once (e.g. bitmap tiling or gradient) and then change its transparency |
| 28 | * w/o having to modify the original shader... only the paint's alpha needs |
| 29 | * to be modified. |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 30 | */ |
ctguil@chromium.org | 7ffb1b2 | 2011-03-15 21:27:08 +0000 | [diff] [blame] | 31 | class SK_API SkShader : public SkFlattenable { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 32 | public: |
| 33 | SkShader(); |
| 34 | virtual ~SkShader(); |
| 35 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 36 | /** |
| 37 | * Return true if the shader has a non-identity local matrix. |
| 38 | * @param localM Optional: If not null, return the shader's local matrix |
| 39 | * @return true if the shader has a non-identity local matrix. |
| 40 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 41 | bool getLocalMatrix(SkMatrix* localM) const; |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Set the shader's local matrix. |
| 45 | * @param localM The shader's new local matrix. |
| 46 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 47 | void setLocalMatrix(const SkMatrix& localM); |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * Reset the shader's local matrix to identity. |
| 51 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 52 | void resetLocalMatrix(); |
| 53 | |
| 54 | enum TileMode { |
reed@google.com | 0beaba5 | 2012-03-16 14:38:06 +0000 | [diff] [blame] | 55 | /** replicate the edge color if the shader draws outside of its |
| 56 | * original bounds |
| 57 | */ |
| 58 | kClamp_TileMode, |
| 59 | |
| 60 | /** repeat the shader's image horizontally and vertically */ |
| 61 | kRepeat_TileMode, |
| 62 | |
| 63 | /** repeat the shader's image horizontally and vertically, alternating |
| 64 | * mirror images so that adjacent images always seam |
| 65 | */ |
| 66 | kMirror_TileMode, |
| 67 | |
| 68 | #if 0 |
| 69 | /** only draw within the original domain, return 0 everywhere else */ |
| 70 | kDecal_TileMode, |
| 71 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 72 | |
| 73 | kTileModeCount |
| 74 | }; |
| 75 | |
| 76 | // override these in your subclass |
| 77 | |
| 78 | enum Flags { |
| 79 | //!< set if all of the colors will be opaque |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 80 | kOpaqueAlpha_Flag = 0x01, |
reed@android.com | 5119bdb | 2009-06-12 21:27:03 +0000 | [diff] [blame] | 81 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 82 | //! set if this shader's shadeSpan16() method can be called |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 83 | kHasSpan16_Flag = 0x02, |
reed@android.com | 5119bdb | 2009-06-12 21:27:03 +0000 | [diff] [blame] | 84 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 85 | /** Set this bit if the shader's native data type is instrinsically 16 |
| 86 | bit, meaning that calling the 32bit shadeSpan() entry point will |
| 87 | mean the the impl has to up-sample 16bit data into 32bit. Used as a |
| 88 | a means of clearing a dither request if the it will have no effect |
| 89 | */ |
reed@android.com | 5119bdb | 2009-06-12 21:27:03 +0000 | [diff] [blame] | 90 | kIntrinsicly16_Flag = 0x04, |
| 91 | |
| 92 | /** set (after setContext) if the spans only vary in X (const in Y). |
| 93 | e.g. an Nx1 bitmap that is being tiled in Y, or a linear-gradient |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 94 | that varies from left-to-right. This flag specifies this for |
| 95 | shadeSpan(). |
reed@android.com | 5119bdb | 2009-06-12 21:27:03 +0000 | [diff] [blame] | 96 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 97 | kConstInY32_Flag = 0x08, |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 98 | |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 99 | /** same as kConstInY32_Flag, but is set if this is true for shadeSpan16 |
| 100 | which may not always be the case, since shadeSpan16 may be |
| 101 | predithered, which would mean it was not const in Y, even though |
| 102 | the 32bit shadeSpan() would be const. |
| 103 | */ |
| 104 | kConstInY16_Flag = 0x10 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 105 | }; |
| 106 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 107 | /** |
| 108 | * Called sometimes before drawing with this shader. Return the type of |
| 109 | * alpha your shader will return. The default implementation returns 0. |
| 110 | * Your subclass should override if it can (even sometimes) report a |
| 111 | * non-zero value, since that will enable various blitters to perform |
| 112 | * faster. |
| 113 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 114 | virtual uint32_t getFlags() { return 0; } |
| 115 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 116 | /** |
junov@chromium.org | b6e1619 | 2011-12-09 15:48:03 +0000 | [diff] [blame] | 117 | * Returns true if the shader is guaranteed to produce only opaque |
| 118 | * colors, subject to the SkPaint using the shader to apply an opaque |
| 119 | * alpha value. Subclasses should override this to allow some |
| 120 | * optimizations. isOpaque() can be called at any time, unlike getFlags, |
| 121 | * which only works properly when the context is set. |
| 122 | */ |
| 123 | virtual bool isOpaque() const { return false; } |
| 124 | |
| 125 | /** |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 126 | * Return the alpha associated with the data returned by shadeSpan16(). If |
| 127 | * kHasSpan16_Flag is not set, this value is meaningless. |
| 128 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 129 | virtual uint8_t getSpan16Alpha() const { return fPaintAlpha; } |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 130 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 131 | /** |
| 132 | * Called once before drawing, with the current paint and device matrix. |
| 133 | * Return true if your shader supports these parameters, or false if not. |
| 134 | * If false is returned, nothing will be drawn. |
| 135 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 136 | virtual bool setContext(const SkBitmap& device, const SkPaint& paint, |
| 137 | const SkMatrix& matrix); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 138 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 139 | /** |
| 140 | * Called for each span of the object being drawn. Your subclass should |
| 141 | * set the appropriate colors (with premultiplied alpha) that correspond |
| 142 | * to the specified device coordinates. |
| 143 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 144 | virtual void shadeSpan(int x, int y, SkPMColor[], int count) = 0; |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 145 | |
| 146 | /** |
| 147 | * Called only for 16bit devices when getFlags() returns |
| 148 | * kOpaqueAlphaFlag | kHasSpan16_Flag |
| 149 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 150 | virtual void shadeSpan16(int x, int y, uint16_t[], int count); |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * Similar to shadeSpan, but only returns the alpha-channel for a span. |
| 154 | * The default implementation calls shadeSpan() and then extracts the alpha |
| 155 | * values from the returned colors. |
| 156 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 157 | virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 158 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 159 | /** |
| 160 | * Helper function that returns true if this shader's shadeSpan16() method |
| 161 | * can be called. |
| 162 | */ |
reed@android.com | 3c9b2a4 | 2009-08-27 19:28:37 +0000 | [diff] [blame] | 163 | bool canCallShadeSpan16() { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 164 | return SkShader::CanCallShadeSpan16(this->getFlags()); |
| 165 | } |
| 166 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 167 | /** |
| 168 | * Helper to check the flags to know if it is legal to call shadeSpan16() |
| 169 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 170 | static bool CanCallShadeSpan16(uint32_t flags) { |
| 171 | return (flags & kHasSpan16_Flag) != 0; |
| 172 | } |
| 173 | |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 174 | /** |
| 175 | * Called before a session using the shader begins. Some shaders override |
| 176 | * this to defer some of their work (like calling bitmap.lockPixels()). |
| 177 | * Must be balanced by a call to endSession. |
| 178 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 179 | virtual void beginSession(); |
| 180 | virtual void endSession(); |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 181 | |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 182 | /** |
| 183 | Gives method bitmap should be read to implement a shader. |
| 184 | Also determines number and interpretation of "extra" parameters returned |
| 185 | by asABitmap |
| 186 | */ |
| 187 | enum BitmapType { |
| 188 | kNone_BitmapType, //<! Shader is not represented as a bitmap |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 189 | kDefault_BitmapType,//<! Access bitmap using local coords transformed |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 190 | // by matrix. No extras |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 191 | kRadial_BitmapType, //<! Access bitmap by transforming local coordinates |
| 192 | // by the matrix and taking the distance of result |
| 193 | // from (0,0) as bitmap column. Bitmap is 1 pixel |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 194 | // tall. No extras |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 195 | kSweep_BitmapType, //<! Access bitmap by transforming local coordinates |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 196 | // by the matrix and taking the angle of result |
| 197 | // to (0,0) as bitmap x coord, where angle = 0 is |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 198 | // bitmap left edge of bitmap = 2pi is the |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 199 | // right edge. Bitmap is 1 pixel tall. No extras |
vandebo@chromium.org | d3ae779 | 2011-02-24 00:21:06 +0000 | [diff] [blame] | 200 | kTwoPointRadial_BitmapType, |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 201 | //<! Matrix transforms to space where (0,0) is |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 202 | // the center of the starting circle. The second |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 203 | // circle will be centered (x, 0) where x may be |
| 204 | // 0. The post-matrix space is normalized such |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 205 | // that 1 is the second radius - first radius. |
| 206 | // Three extra parameters are returned: |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 207 | // 0: x-offset of second circle center |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 208 | // to first. |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 209 | // 1: radius of first circle in post-matrix |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 210 | // space |
| 211 | // 2: the second radius minus the first radius |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 212 | // in pre-transformed space. |
vandebo@chromium.org | d3ae779 | 2011-02-24 00:21:06 +0000 | [diff] [blame] | 213 | |
| 214 | kLast_BitmapType = kTwoPointRadial_BitmapType |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 215 | }; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 216 | /** Optional methods for shaders that can pretend to be a bitmap/texture |
reed@google.com | 7c2f27d | 2011-03-07 19:29:00 +0000 | [diff] [blame] | 217 | to play along with opengl. Default just returns kNone_BitmapType and |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 218 | ignores the out parameters. |
| 219 | |
| 220 | @param outTexture if non-NULL will be the bitmap representing the shader |
| 221 | after return. |
| 222 | @param outMatrix if non-NULL will be the matrix to apply to vertices |
| 223 | to access the bitmap after return. |
| 224 | @param xy if non-NULL will be the tile modes that should be |
| 225 | used to access the bitmap after return. |
| 226 | @param twoPointRadialParams Two extra return values needed for two point |
| 227 | radial bitmaps. The first is the x-offset of |
| 228 | the second point and the second is the radius |
| 229 | about the first point. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 230 | */ |
reed@android.com | f2b98d6 | 2010-12-20 18:26:13 +0000 | [diff] [blame] | 231 | virtual BitmapType asABitmap(SkBitmap* outTexture, SkMatrix* outMatrix, |
reed@google.com | ad91799 | 2011-04-11 19:01:12 +0000 | [diff] [blame] | 232 | TileMode xy[2], SkScalar* twoPointRadialParams) const; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 233 | |
vandebo@chromium.org | d3ae779 | 2011-02-24 00:21:06 +0000 | [diff] [blame] | 234 | /** |
| 235 | * If the shader subclass can be represented as a gradient, asAGradient |
| 236 | * returns the matching GradientType enum (or kNone_GradientType if it |
| 237 | * cannot). Also, if info is not null, asAGradient populates info with |
| 238 | * the relevant (see below) parameters for the gradient. fColorCount |
| 239 | * is both an input and output parameter. On input, it indicates how |
| 240 | * many entries in fColors and fColorOffsets can be used, if they are |
| 241 | * non-NULL. After asAGradient has run, fColorCount indicates how |
| 242 | * many color-offset pairs there are in the gradient. If there is |
| 243 | * insufficient space to store all of the color-offset pairs, fColors |
| 244 | * and fColorOffsets will not be altered. fColorOffsets specifies |
| 245 | * where on the range of 0 to 1 to transition to the given color. |
| 246 | * The meaning of fPoint and fRadius is dependant on the type of gradient. |
| 247 | * |
| 248 | * None: |
| 249 | * info is ignored. |
| 250 | * Color: |
| 251 | * fColorOffsets[0] is meaningless. |
| 252 | * Linear: |
| 253 | * fPoint[0] and fPoint[1] are the end-points of the gradient |
| 254 | * Radial: |
| 255 | * fPoint[0] and fRadius[0] are the center and radius |
| 256 | * Radial2: |
| 257 | * fPoint[0] and fRadius[0] are the center and radius of the 1st circle |
| 258 | * fPoint[1] and fRadius[1] are the center and radius of the 2nd circle |
| 259 | * Sweep: |
| 260 | * fPoint[0] is the center of the sweep. |
| 261 | */ |
| 262 | |
| 263 | enum GradientType { |
| 264 | kNone_GradientType, |
| 265 | kColor_GradientType, |
| 266 | kLinear_GradientType, |
| 267 | kRadial_GradientType, |
| 268 | kRadial2_GradientType, |
| 269 | kSweep_GradientType, |
| 270 | kLast_GradientType = kSweep_GradientType |
| 271 | }; |
| 272 | |
| 273 | struct GradientInfo { |
| 274 | int fColorCount; //!< In-out parameter, specifies passed size |
| 275 | // of fColors/fColorOffsets on input, and |
| 276 | // actual number of colors/offsets on |
| 277 | // output. |
| 278 | SkColor* fColors; //!< The colors in the gradient. |
| 279 | SkScalar* fColorOffsets; //!< The unit offset for color transitions. |
| 280 | SkPoint fPoint[2]; //!< Type specific, see above. |
| 281 | SkScalar fRadius[2]; //!< Type specific, see above. |
| 282 | TileMode fTileMode; //!< The tile mode used. |
| 283 | }; |
| 284 | |
| 285 | virtual GradientType asAGradient(GradientInfo* info) const; |
| 286 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 287 | ////////////////////////////////////////////////////////////////////////// |
| 288 | // Factory methods for stock shaders |
| 289 | |
| 290 | /** Call this to create a new shader that will draw with the specified bitmap. |
reed@google.com | 99c114e | 2012-05-03 20:14:26 +0000 | [diff] [blame] | 291 | * |
| 292 | * If the bitmap cannot be used (e.g. has no pixels, or its dimensions |
| 293 | * exceed implementation limits (currently at 64K - 1)) then SkEmptyShader |
| 294 | * may be returned. |
| 295 | * |
| 296 | * @param src The bitmap to use inside the shader |
| 297 | * @param tmx The tiling mode to use when sampling the bitmap in the x-direction. |
| 298 | * @param tmy The tiling mode to use when sampling the bitmap in the y-direction. |
| 299 | * @return Returns a new shader object. Note: this function never returns null. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 300 | */ |
| 301 | static SkShader* CreateBitmapShader(const SkBitmap& src, |
| 302 | TileMode tmx, TileMode tmy); |
| 303 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 304 | protected: |
| 305 | enum MatrixClass { |
| 306 | kLinear_MatrixClass, // no perspective |
| 307 | kFixedStepInX_MatrixClass, // fast perspective, need to call fixedStepInX() each scanline |
| 308 | kPerspective_MatrixClass // slow perspective, need to mappoints each pixel |
| 309 | }; |
| 310 | static MatrixClass ComputeMatrixClass(const SkMatrix&); |
| 311 | |
| 312 | // These can be called by your subclass after setContext() has been called |
| 313 | uint8_t getPaintAlpha() const { return fPaintAlpha; } |
| 314 | SkBitmap::Config getDeviceConfig() const { return (SkBitmap::Config)fDeviceConfig; } |
| 315 | const SkMatrix& getTotalInverse() const { return fTotalInverse; } |
| 316 | MatrixClass getInverseClass() const { return (MatrixClass)fTotalInverseClass; } |
| 317 | |
| 318 | SkShader(SkFlattenableReadBuffer& ); |
djsollen@google.com | 5492424 | 2012-03-29 15:18:04 +0000 | [diff] [blame] | 319 | virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 320 | private: |
| 321 | SkMatrix* fLocalMatrix; |
| 322 | SkMatrix fTotalInverse; |
| 323 | uint8_t fPaintAlpha; |
| 324 | uint8_t fDeviceConfig; |
| 325 | uint8_t fTotalInverseClass; |
| 326 | SkDEBUGCODE(SkBool8 fInSession;) |
| 327 | |
| 328 | static SkShader* CreateBitmapShader(const SkBitmap& src, |
| 329 | TileMode, TileMode, |
| 330 | void* storage, size_t storageSize); |
| 331 | friend class SkAutoBitmapShaderInstall; |
| 332 | typedef SkFlattenable INHERITED; |
| 333 | }; |
| 334 | |
| 335 | #endif |
| 336 | |