diff options
author | 2014-06-10 14:38:28 -0700 | |
---|---|---|
committer | 2014-06-10 14:38:28 -0700 | |
commit | 9de5b514d38c5b36066bcdc14fba2f7e5196d372 (patch) | |
tree | 8dfe270706133558dab7f076a27a0298ec38cc64 /src/core/SkPictureShader.cpp | |
parent | ce06c485a2d897eeb3e997ed6a546e77e99e47be (diff) |
SkShader::asNewEffect Refactoring
The new signature is:
bool asNewEffect(GrContext* context, const SkPaint& paint, GrColor* grColor, GrEffectRef** grEffect, const SkMatrix* localMatrixOrNull) const;
It will fix the hack for skcolorshader by modifying the GrColor parameter in SkGr::SkPaint2GrPaintShader.
BUG=skia:2646
R=jvanverth@google.com, bsalomon@google.com
Author: dandov@google.com
Review URL: https://codereview.chromium.org/318923005
Diffstat (limited to 'src/core/SkPictureShader.cpp')
-rw-r--r-- | src/core/SkPictureShader.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index 81e13752f6..2de8d4d4cb 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -188,12 +188,20 @@ void SkPictureShader::toString(SkString* str) const { #endif #if SK_SUPPORT_GPU -GrEffectRef* SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint, - const SkMatrix* localMatrix) const { +bool SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint, + const SkMatrix* localMatrix, GrColor* grColor, + GrEffectRef** grEffect) const { SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(context->getMatrix(), localMatrix)); if (!bitmapShader) { - return NULL; + return false; } - return bitmapShader->asNewEffect(context, paint, NULL); + return bitmapShader->asNewEffect(context, paint, NULL, grColor, grEffect); +} +#else +bool SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint, + const SkMatrix* localMatrix, GrColor* grColor, + GrEffectRef** grEffect) const { + SkDEBUGFAIL("Should not call in GPU-less build"); + return false; } #endif |