From e28a6b55dfbcd510d86cca39a167d179b81e4f4c Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 25 Jul 2018 13:05:17 -0400 Subject: 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 Commit-Queue: Brian Osman Reviewed-by: Brian Osman --- bench/VertexColorSpaceBench.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bench') diff --git a/bench/VertexColorSpaceBench.cpp b/bench/VertexColorSpaceBench.cpp index 4e300b7689..8af1db290f 100644 --- a/bench/VertexColorSpaceBench.cpp +++ b/bench/VertexColorSpaceBench.cpp @@ -13,6 +13,7 @@ #include "GrMemoryPool.h" #include "GrRenderTargetContext.h" #include "GrRenderTargetContextPriv.h" +#include "SkColorSpacePriv.h" #include "SkGr.h" #include "SkString.h" #include "glsl/GrGLSLColorSpaceXformHelper.h" @@ -232,7 +233,7 @@ public: SkASSERT(context); auto p3 = SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, SkColorSpace::kDCIP3_D65_Gamut); - auto xform = GrColorSpaceXform::MakeUnpremulToUnpremul(SkColorSpace::MakeSRGB().get(), + auto xform = GrColorSpaceXform::MakeUnpremulToUnpremul(sk_srgb_singleton(), p3.get()); SkRandom r; -- cgit v1.2.3