diff options
author | Mike Klein <mtklein@chromium.org> | 2017-08-09 13:51:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-09 18:51:44 +0000 |
commit | a07e4302cfefc282d8d235edfbc20a54c75afa88 (patch) | |
tree | 213da9d00c56d3cf3f8056410a81da60388dc933 /src/core/SkColorSpaceXform.cpp | |
parent | b681a0f1b0acebe36130fd463d14016d48295b97 (diff) |
add gamma stage
Until now we've been using 3 separate parametric stages to apply
gamma to r,g,b. That works fine, but is kind of unnecessarily
slow, and again less clear in a stack trace than seeing "gamma".
The new bench runs in about 60% of the time the old one does
on my Trashcan.
BUG=skia:6939
Change-Id: I079698d3009b081f1c23a2e27fc26e373b439610
Reviewed-on: https://skia-review.googlesource.com/32721
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkColorSpaceXform.cpp')
-rw-r--r-- | src/core/SkColorSpaceXform.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp index 8c23bf8718..b5290aab8e 100644 --- a/src/core/SkColorSpaceXform.cpp +++ b/src/core/SkColorSpaceXform.cpp @@ -588,17 +588,13 @@ bool SkColorSpaceXform_XYZ<kCSM> } TablesContext tables; - SkColorSpaceTransferFn to_2dot2 = {0,0,0,0,0,0,0}; - to_2dot2.fG = 1/2.2f; - to_2dot2.fA = 1; + float to_2dot2 = 1/2.2f; switch (fDstGamma) { case kSRGB_DstGamma: pipeline.append(SkRasterPipeline::to_srgb); break; case k2Dot2_DstGamma: - pipeline.append(SkRasterPipeline::parametric_r, &to_2dot2); - pipeline.append(SkRasterPipeline::parametric_g, &to_2dot2); - pipeline.append(SkRasterPipeline::parametric_b, &to_2dot2); + pipeline.append(SkRasterPipeline::gamma, &to_2dot2); break; case kTable_DstGamma: tables.fR = fDstGammaTables[0]; |