diff options
author | 2016-07-21 13:28:36 -0700 | |
---|---|---|
committer | 2016-07-21 13:28:36 -0700 | |
commit | dfe4f2e4fe5b162d4adb4486fe751f1e3b30bea7 (patch) | |
tree | aa6ff74a25306386a0c5b5586a4843b470d80101 /include/core | |
parent | 8602ede5fdfa721dcad4dcb11db028c1c24265f1 (diff) |
Add SkColorSpace to GrDrawContext
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164363002
Review-Url: https://codereview.chromium.org/2164363002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkSurface.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index 6c85be04bb..4d38d300c9 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -82,7 +82,7 @@ public: /** * Return a new surface using the specified render target. */ - static sk_sp<SkSurface> MakeRenderTargetDirect(GrRenderTarget*, + static sk_sp<SkSurface> MakeRenderTargetDirect(GrRenderTarget*, sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* = nullptr); /** @@ -92,7 +92,7 @@ public: * SkSurface. */ static sk_sp<SkSurface> MakeFromBackendTexture(GrContext*, const GrBackendTextureDesc&, - const SkSurfaceProps*); + sk_sp<SkColorSpace>, const SkSurfaceProps*); /** * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume @@ -101,6 +101,7 @@ public: */ static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext*, const GrBackendRenderTargetDesc&, + sk_sp<SkColorSpace>, const SkSurfaceProps*); /** @@ -112,7 +113,28 @@ public: * SkSurface. */ static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget( - GrContext*, const GrBackendTextureDesc&, const SkSurfaceProps*); + GrContext*, const GrBackendTextureDesc&, sk_sp<SkColorSpace>, const SkSurfaceProps*); + + /** + * Legacy versions of the above factories, without color space support. These create "legacy" + * surfaces that operate without gamma correction or color management. + */ + static sk_sp<SkSurface> MakeFromBackendTexture(GrContext* ctx, const GrBackendTextureDesc& desc, + const SkSurfaceProps* props) { + return MakeFromBackendTexture(ctx, desc, nullptr, props); + } + + static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* ctx, + const GrBackendRenderTargetDesc& desc, + const SkSurfaceProps* props) { + return MakeFromBackendRenderTarget(ctx, desc, nullptr, props); + } + + static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget( + GrContext* ctx, const GrBackendTextureDesc& desc, const SkSurfaceProps* props) { + return MakeFromBackendTextureAsRenderTarget(ctx, desc, nullptr, props); + } + /** * Return a new surface whose contents will be drawn to an offscreen @@ -149,7 +171,7 @@ public: return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); } static SkSurface* NewRenderTargetDirect(GrRenderTarget* rt, const SkSurfaceProps* props) { - return MakeRenderTargetDirect(rt, props).release(); + return MakeRenderTargetDirect(rt, nullptr, props).release(); } static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { return NewRenderTargetDirect(target, NULL); |