aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-07-25 13:05:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-25 23:51:15 +0000
commite28a6b55dfbcd510d86cca39a167d179b81e4f4c (patch)
tree7d9151d55b67f749fd701b7c8fe52b6f922988d3 /tests
parent68300c270916b2740fccdbe6c6dce8f085e83316 (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 'tests')
-rw-r--r--tests/CodecTest.cpp2
-rw-r--r--tests/ColorSpaceTest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index 179994be7c..36e6b28075 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -1486,7 +1486,7 @@ static void test_encode_icc(skiatest::Reporter* r, SkEncodedImageFormat format)
encode_format(&srgbBuf, pixmap, format);
sk_sp<SkData> srgbData = srgbBuf.detachAsData();
std::unique_ptr<SkCodec> srgbCodec(SkCodec::MakeFromData(srgbData));
- REPORTER_ASSERT(r, srgbCodec->getInfo().colorSpace() == SkColorSpace::MakeSRGB().get());
+ REPORTER_ASSERT(r, srgbCodec->getInfo().colorSpace() == sk_srgb_singleton());
// Test with P3 color space.
SkDynamicMemoryWStream p3Buf;
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index c8d6a06e66..2e2687c591 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -80,7 +80,7 @@ static constexpr float g_sRGB_G[]{ 0.3853f, 0.7170f, 0.0971f };
static constexpr float g_sRGB_B[]{ 0.1430f, 0.0606f, 0.7139f };
DEF_TEST(ColorSpace_sRGB, r) {
- test_space(r, SkColorSpace::MakeSRGB().get(),
+ test_space(r, sk_srgb_singleton(),
g_sRGB_R, g_sRGB_G, g_sRGB_B, kSRGB_SkGammaNamed);
}