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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/image/SkSurface_Gpu.cpp
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index fa3781476fb4c41d802c4183de26868aa13f4184..75017e954e09f210a32469056a4113bb5bfc5332 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -134,9 +134,11 @@ void SkSurface_Gpu::onPrepareForExternalIO() {
///////////////////////////////////////////////////////////////////////////////
sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget* target,
+ sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props) {
sk_sp<SkGpuDevice> device(
- SkGpuDevice::Make(sk_ref_sp(target), props, SkGpuDevice::kUninit_InitContents));
+ SkGpuDevice::Make(sk_ref_sp(target), std::move(colorSpace), props,
+ SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
}
@@ -156,6 +158,7 @@ sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext* ctx, SkBudgeted budgeted
sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context,
const GrBackendTextureDesc& desc,
+ sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props) {
if (nullptr == context) {
return nullptr;
@@ -168,7 +171,8 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context,
if (!surface) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(sk_ref_sp(surface->asRenderTarget()), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(sk_ref_sp(surface->asRenderTarget()),
+ std::move(colorSpace), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
@@ -178,6 +182,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context,
sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
const GrBackendRenderTargetDesc& desc,
+ sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props) {
if (!context) {
return nullptr;
@@ -186,7 +191,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
if (!rt) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), std::move(colorSpace), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
@@ -196,6 +201,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* context,
const GrBackendTextureDesc& desc,
+ sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props) {
if (!context) {
return nullptr;
@@ -204,7 +210,7 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
if (!rt) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), std::move(colorSpace), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698