diff options
author | Mike Klein <mtklein@chromium.org> | 2018-07-25 13:05:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-25 23:51:15 +0000 |
commit | e28a6b55dfbcd510d86cca39a167d179b81e4f4c (patch) | |
tree | 7d9151d55b67f749fd701b7c8fe52b6f922988d3 /src/core/SkBlitter_Sprite.cpp | |
parent | 68300c270916b2740fccdbe6c6dce8f085e83316 (diff) |
add explicit accessor for sRGB singleton colorspaces
SkColorSpace::MakeSRGB().get() is scary, and causes more ref/unref
pairs than strictly necessary for these singletons.
This time the implementation is still in SkColorSpace.cpp,
so these should really work as singletons.
Change-Id: I40f2942c8dcde3040663a04c4f5330aca90868ae
Reviewed-on: https://skia-review.googlesource.com/143305
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core/SkBlitter_Sprite.cpp')
-rw-r--r-- | src/core/SkBlitter_Sprite.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp index b26b712d93..e0998d9608 100644 --- a/src/core/SkBlitter_Sprite.cpp +++ b/src/core/SkBlitter_Sprite.cpp @@ -7,6 +7,7 @@ #include "SkArenaAlloc.h" #include "SkColorSpace.h" +#include "SkColorSpacePriv.h" #include "SkColorSpaceXformSteps.h" #include "SkCoreBlitters.h" #include "SkOpts.h" @@ -143,7 +144,7 @@ public: if (!srcCS || fSource.colorType() == kAlpha_8_SkColorType) { // We treat untagged images as sRGB. // A8 images get their r,g,b from the paint color, so they're also sRGB. - srcCS = SkColorSpace::MakeSRGB().get(); + srcCS = sk_srgb_singleton(); } fAlloc->make<SkColorSpaceXformSteps>(srcCS, kPremul_SkAlphaType, dstCS) ->apply(&p); |