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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring 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/gpu/GrPaint.h ('k') | src/effects/SkBlurMaskFilter.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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698