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

Unified Diff: src/gpu/SkGpuDevice.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrTextureToYUVPlanes.cpp ('k') | src/gpu/effects/Gr1DKernelEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index e9baae54a8740d4a353e06e59787479e22dd18a8..db4edb5d57ef8c93ef26781db650f3a2466f4f0e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1145,6 +1145,9 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
return;
}
+ SkColorSpace* dstColorSpace = nullptr; // XFORMTODO
+ sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(bitmap.colorSpace(),
+ dstColorSpace);
SkRect dstRect = {0, 0, srcRect.width(), srcRect.height() };
SkRect paintRect;
SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width()));
@@ -1189,17 +1192,19 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
}
textureDomain.setLTRB(left, top, right, bottom);
if (bicubic) {
- fp = GrBicubicEffect::Make(texture, texMatrix, textureDomain);
+ fp = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), texMatrix,
+ textureDomain);
} else {
- fp = GrTextureDomainEffect::Make(texture, texMatrix, textureDomain,
- GrTextureDomain::kClamp_Mode, params.filterMode());
+ fp = GrTextureDomainEffect::Make(texture, std::move(colorSpaceXform), texMatrix,
+ textureDomain, GrTextureDomain::kClamp_Mode,
+ params.filterMode());
}
} else if (bicubic) {
SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
- fp = GrBicubicEffect::Make(texture, texMatrix, tileModes);
+ fp = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), texMatrix, tileModes);
} else {
- fp = GrSimpleTextureEffect::Make(texture, texMatrix, params);
+ fp = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), texMatrix, params);
}
GrPaint grPaint;
@@ -1287,7 +1292,8 @@ void SkGpuDevice::drawSpecial(const SkDraw& draw,
tmpUnfiltered.setImageFilter(nullptr);
GrPaint grPaint;
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(), SkMatrix::I()));
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(), nullptr,
+ SkMatrix::I()));
if (GrPixelConfigIsAlphaOnly(texture->config())) {
fp = GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(fp));
} else {
« no previous file with comments | « src/gpu/GrTextureToYUVPlanes.cpp ('k') | src/gpu/effects/Gr1DKernelEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698