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 GrProcessorDataManager* procDataManage
r, |
340 GrFragmentProcessor** fp) const { | 340 GrFragmentProcessor** fp) const { |
341 int maxTextureSize = 0; | 341 int maxTextureSize = 0; |
342 if (context) { | 342 if (context) { |
343 maxTextureSize = context->caps()->maxTextureSize(); | 343 maxTextureSize = context->caps()->maxTextureSize(); |
344 } | 344 } |
345 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); | 345 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); |
346 if (!bitmapShader) { | 346 if (!bitmapShader) { |
347 return false; | 347 return false; |
348 } | 348 } |
349 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, | 349 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC
olor, |
350 shaderDataManager, fp); | 350 procDataManager, fp); |
351 } | 351 } |
352 #else | 352 #else |
353 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, | 353 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa
trix&, |
354 const SkMatrix*, GrColor*, GrShaderDat
aManager*, | 354 const SkMatrix*, GrColor*, GrProcessor
DataManager*, |
355 GrFragmentProcessor**) const { | 355 GrFragmentProcessor**) const { |
356 SkDEBUGFAIL("Should not call in GPU-less build"); | 356 SkDEBUGFAIL("Should not call in GPU-less build"); |
357 return false; | 357 return false; |
358 } | 358 } |
359 #endif | 359 #endif |
OLD | NEW |