| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkShader_DEFINED | 10 #ifndef SkShader_DEFINED |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 SkScalar* fColorOffsets; //!< The unit offset for color transitions. | 311 SkScalar* fColorOffsets; //!< The unit offset for color transitions. |
| 312 SkPoint fPoint[2]; //!< Type specific, see above. | 312 SkPoint fPoint[2]; //!< Type specific, see above. |
| 313 SkScalar fRadius[2]; //!< Type specific, see above. | 313 SkScalar fRadius[2]; //!< Type specific, see above. |
| 314 TileMode fTileMode; //!< The tile mode used. | 314 TileMode fTileMode; //!< The tile mode used. |
| 315 uint32_t fGradientFlags; //!< see SkGradientShader::Flags | 315 uint32_t fGradientFlags; //!< see SkGradientShader::Flags |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 virtual GradientType asAGradient(GradientInfo* info) const; | 318 virtual GradientType asAGradient(GradientInfo* info) const; |
| 319 | 319 |
| 320 /** | 320 /** |
| 321 * If the shader subclass has a GrEffect implementation, this installs an e
ffect on the stage. | 321 * If the shader subclass has a GrEffect implementation, this resturns the
effect to install. |
| 322 * The GrContext may be used by the effect to create textures. The GPU devi
ce does not call | 322 * The incoming color to the effect has r=g=b=a all extracted from the SkPa
int's alpha. |
| 323 * setContext. Instead we pass the paint here in case the shader needs pain
t info. | 323 * The output color should be the computed SkShader premul color modulated
by the incoming |
| 324 * color. The GrContext may be used by the effect to create textures. The G
PU device does not |
| 325 * call setContext. Instead we pass the SkPaint here in case the shader nee
ds paint info. |
| 324 */ | 326 */ |
| 325 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint) c
onst; | 327 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint& paint) c
onst; |
| 326 | 328 |
| 327 ////////////////////////////////////////////////////////////////////////// | 329 ////////////////////////////////////////////////////////////////////////// |
| 328 // Factory methods for stock shaders | 330 // Factory methods for stock shaders |
| 329 | 331 |
| 330 /** Call this to create a new shader that will draw with the specified bitma
p. | 332 /** Call this to create a new shader that will draw with the specified bitma
p. |
| 331 * | 333 * |
| 332 * If the bitmap cannot be used (e.g. has no pixels, or its dimensions | 334 * If the bitmap cannot be used (e.g. has no pixels, or its dimensions |
| 333 * exceed implementation limits (currently at 64K - 1)) then SkEmptyShader | 335 * exceed implementation limits (currently at 64K - 1)) then SkEmptyShader |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 SkDEBUGCODE(SkBool8 fInSetContext;) | 370 SkDEBUGCODE(SkBool8 fInSetContext;) |
| 369 | 371 |
| 370 static SkShader* CreateBitmapShader(const SkBitmap& src, | 372 static SkShader* CreateBitmapShader(const SkBitmap& src, |
| 371 TileMode, TileMode, | 373 TileMode, TileMode, |
| 372 void* storage, size_t storageSize); | 374 void* storage, size_t storageSize); |
| 373 friend class SkAutoBitmapShaderInstall; | 375 friend class SkAutoBitmapShaderInstall; |
| 374 typedef SkFlattenable INHERITED; | 376 typedef SkFlattenable INHERITED; |
| 375 }; | 377 }; |
| 376 | 378 |
| 377 #endif | 379 #endif |
| OLD | NEW |