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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2180803005: Add color gamut xform helpers to GrGLSLShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@xform-storage
Patch Set: Rebase Created 4 years, 3 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
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 64df998e2fa6b4a38cf3489da0d3c48f2a7b151d..ca84121015a647ee5fd2d331c2d9579f1ba09cf5 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1010,7 +1010,8 @@ void SkGpuDevice::drawBitmapTile(const SkBitmap& bitmap,
}
sk_sp<GrColorSpaceXform> colorSpaceXform =
- GrColorSpaceXform::Make(bitmap.colorSpace(), fDrawContext->getColorSpace());
+ GrColorSpaceXform::Make(bitmap.colorSpace(), fDrawContext->getColorSpace(),
+ bitmap.alphaType());
SkScalar iw = 1.f / texture->width();
SkScalar ih = 1.f / texture->height();
@@ -1134,8 +1135,12 @@ void SkGpuDevice::drawSpecial(const SkDraw& draw,
SkPaint tmpUnfiltered(paint);
tmpUnfiltered.setImageFilter(nullptr);
+ sk_sp<GrColorSpaceXform> colorSpaceXform =
+ GrColorSpaceXform::Make(result->getColorSpace(), fDrawContext->getColorSpace(),
+ result->alphaType());
GrPaint grPaint;
- sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(), nullptr,
+ sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(),
+ std::move(colorSpaceXform),
SkMatrix::I()));
if (GrPixelConfigIsAlphaOnly(texture->config())) {
fp = GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(fp));

Powered by Google App Engine
This is Rietveld 408576698