Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: include/core/SkSurface.h

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « example/HelloWorld.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkSurface.h
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 6c85be04bb959c382dccef6d7e62ea0b646da8af..4d38d300c90ce888401dfdbcbd84a57b1b236d2d 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);
« no previous file with comments | « example/HelloWorld.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698