| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPictureShader.h" | 8 #include "SkPictureShader.h" |
| 9 | 9 |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 fPicture ? fPicture->width() : 0, | 181 fPicture ? fPicture->width() : 0, |
| 182 fPicture ? fPicture->height() : 0); | 182 fPicture ? fPicture->height() : 0); |
| 183 | 183 |
| 184 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]); | 184 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]); |
| 185 | 185 |
| 186 this->INHERITED::toString(str); | 186 this->INHERITED::toString(str); |
| 187 } | 187 } |
| 188 #endif | 188 #endif |
| 189 | 189 |
| 190 #if SK_SUPPORT_GPU | 190 #if SK_SUPPORT_GPU |
| 191 GrEffectRef* SkPictureShader::asNewEffect(GrContext* context, const SkPaint& pai
nt, | 191 bool SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint, |
| 192 const SkMatrix* localMatrix) const { | 192 const SkMatrix* localMatrix, GrColor* grColor, |
| 193 GrEffectRef** grEffect) const { |
| 193 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(context->getMatrix
(), localMatrix)); | 194 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(context->getMatrix
(), localMatrix)); |
| 194 if (!bitmapShader) { | 195 if (!bitmapShader) { |
| 195 return NULL; | 196 *grColor = this->getColorAsAlpha(paint); |
| 197 return false; |
| 196 } | 198 } |
| 197 return bitmapShader->asNewEffect(context, paint, NULL); | 199 return bitmapShader->asNewEffect(context, paint, NULL, grColor, grEffect); |
| 198 } | 200 } |
| 199 #endif | 201 #endif |
| OLD | NEW |