OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmapProcShader.h" | 8 #include "SkBitmapProcShader.h" |
9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
10 #include "SkBitmapProvider.h" | 10 #include "SkBitmapProvider.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 &doBicubic); | 453 &doBicubic); |
454 GrTextureParams params(tm, textureFilterMode); | 454 GrTextureParams params(tm, textureFilterMode); |
455 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap
, params, | 455 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fRawBitmap
, params, |
456 gammaTreatment)); | 456 gammaTreatment)); |
457 | 457 |
458 if (!texture) { | 458 if (!texture) { |
459 SkErrorInternals::SetError( kInternalError_SkError, | 459 SkErrorInternals::SetError( kInternalError_SkError, |
460 "Couldn't convert bitmap to texture."); | 460 "Couldn't convert bitmap to texture."); |
461 return nullptr; | 461 return nullptr; |
462 } | 462 } |
463 | 463 SkColorSpace* dstColorSpace = nullptr; // XFORMTODO |
| 464 sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(fRawBitma
p.colorSpace(), |
| 465 dstColorS
pace); |
464 sk_sp<GrFragmentProcessor> inner; | 466 sk_sp<GrFragmentProcessor> inner; |
465 if (doBicubic) { | 467 if (doBicubic) { |
466 inner = GrBicubicEffect::Make(texture, matrix, tm); | 468 inner = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), matri
x, tm); |
467 } else { | 469 } else { |
468 inner = GrSimpleTextureEffect::Make(texture, matrix, params); | 470 inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform),
matrix, params); |
469 } | 471 } |
470 | 472 |
471 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { | 473 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { |
472 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne
r)); | 474 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne
r)); |
473 } | 475 } |
474 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); | 476 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); |
475 } | 477 } |
476 | 478 |
477 #endif | 479 #endif |
OLD | NEW |