aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-06-05 12:24:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-05 16:51:59 +0000
commit2f2a703f33c46800962db32e19faf9c13d26f3d5 (patch)
treefbe442d3cbe9739c0f399bd7f14307d777ef3c30 /src
parent12f25a2c220449ad42080bb6896e74d2198f9213 (diff)
add upm->upm helper
Change-Id: I912e58339b3b84be17d6a98d52cbc11f376c9a89 Reviewed-on: https://skia-review.googlesource.com/132093 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkColorSpaceXformSteps.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkColorSpaceXformSteps.h b/src/core/SkColorSpaceXformSteps.h
index 07e968d65e..6c38411692 100644
--- a/src/core/SkColorSpaceXformSteps.h
+++ b/src/core/SkColorSpaceXformSteps.h
@@ -15,6 +15,13 @@ struct SkColorSpaceXformSteps {
SkColorSpaceXformSteps(SkColorSpace* src, SkAlphaType srcAT,
SkColorSpace* dst);
+ static SkColorSpaceXformSteps UnpremulToUnpremul(SkColorSpace* src, SkColorSpace* dst) {
+ // The need to transform unpremul to unpremul comes up often enough that it's
+ // nice to centralize it here, especially because this use of kOpaque_SkAlphaType
+ // isn't the most intuitive. We basically want to always skip unpremul and premul.
+ return SkColorSpaceXformSteps(src, kOpaque_SkAlphaType, dst);
+ }
+
bool unpremul;
bool linearize;
bool gamut_transform;