| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]); | 329 str->appendf("(%s, %s)", gTileModeName[fTmx], gTileModeName[fTmy]); |
| 330 | 330 |
| 331 this->INHERITED::toString(str); | 331 this->INHERITED::toString(str); |
| 332 } | 332 } |
| 333 #endif | 333 #endif |
| 334 | 334 |
| 335 #if SK_SUPPORT_GPU | 335 #if SK_SUPPORT_GPU |
| 336 bool SkPictureShader::asFragmentProcessor(GrContext* context, const SkPaint& pai
nt, | 336 bool SkPictureShader::asFragmentProcessor(GrContext* context, const SkPaint& pai
nt, |
| 337 const SkMatrix& viewM, const SkMatrix*
localMatrix, | 337 const SkMatrix& viewM, const SkMatrix*
localMatrix, |
| 338 GrColor* paintColor, | 338 GrColor* paintColor, |
| 339 GrShaderDataManager* shaderDataManager
, |
| 339 GrFragmentProcessor** fp) const { | 340 GrFragmentProcessor** fp) const { |
| 340 int maxTextureSize = 0; | 341 int maxTextureSize = 0; |
| 341 if (context) { | 342 if (context) { |
| 342 maxTextureSize = context->caps()->maxTextureSize(); | 343 maxTextureSize = context->caps()->maxTextureSize(); |
| 343 } | 344 } |
| 344 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); | 345 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); |
| 345 if (!bitmapShader) { | 346 if (!bitmapShader) { |
| 346 return false; | 347 return false; |
| 347 } | 348 } |
| 348 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, fp); | 349 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, |
| 350 shaderDataManager, fp); |
| 349 } | 351 } |
| 350 #else | 352 #else |
| 351 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, | 353 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, |
| 352 const SkMatrix*, GrColor*, | 354 const SkMatrix*, GrColor*, GrShaderDat
aManager*, |
| 353 GrFragmentProcessor**) const { | 355 GrFragmentProcessor**) const { |
| 354 SkDEBUGFAIL("Should not call in GPU-less build"); | 356 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 355 return false; | 357 return false; |
| 356 } | 358 } |
| 357 #endif | 359 #endif |
| OLD | NEW |