Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: src/core/SkBitmapProcShader.cpp

Issue 2180503002: Add destination color space to AsFPArgs. Eliminates last XFORMTODO. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 this->getLocalMatrix(), &doBicubic); 450 this->getLocalMatrix(), &doBicubic);
451 GrTextureParams params(tm, textureFilterMode); 451 GrTextureParams params(tm, textureFilterMode);
452 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(args.fContext, fRaw Bitmap, params, 452 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(args.fContext, fRaw Bitmap, params,
453 args.fGammaTreatmen t)); 453 args.fGammaTreatmen t));
454 454
455 if (!texture) { 455 if (!texture) {
456 SkErrorInternals::SetError( kInternalError_SkError, 456 SkErrorInternals::SetError( kInternalError_SkError,
457 "Couldn't convert bitmap to texture."); 457 "Couldn't convert bitmap to texture.");
458 return nullptr; 458 return nullptr;
459 } 459 }
460 SkColorSpace* dstColorSpace = nullptr; // XFORMTODO
461 sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(fRawBitma p.colorSpace(), 460 sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(fRawBitma p.colorSpace(),
462 dstColorS pace); 461 args.fDst ColorSpace);
463 sk_sp<GrFragmentProcessor> inner; 462 sk_sp<GrFragmentProcessor> inner;
464 if (doBicubic) { 463 if (doBicubic) {
465 inner = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), matri x, tm); 464 inner = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), matri x, tm);
466 } else { 465 } else {
467 inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), matrix, params); 466 inner = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), matrix, params);
468 } 467 }
469 468
470 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { 469 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) {
471 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne r)); 470 return GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(inne r));
472 } 471 }
473 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)); 472 return GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner));
474 } 473 }
475 474
476 #endif 475 #endif
OLDNEW
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698