aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawingManager.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-13 09:25:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-13 14:48:23 +0000
commit366093f2124c38fa5c590c9ed2d1811817fed8ee (patch)
treea4d4d1b15a425704a7ea09575d7ce7c97bc4c2a7 /src/gpu/GrDrawingManager.cpp
parenta3cc32c94579289e99ca46235602a13f20fe5996 (diff)
Make it so that GrSurfaceContext with a sRGB GrPixelConfig must have a
color space with a sRGB-like gamma. Change-Id: I99b80a9846caacd6848b0f9f55ed0f7f23e69b90 Reviewed-on: https://skia-review.googlesource.com/106640 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r--src/gpu/GrDrawingManager.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 52bad77d53..de6722f998 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -474,9 +474,8 @@ sk_sp<GrRenderTargetContext> GrDrawingManager::makeRenderTargetContext(
}
// SkSurface catches bad color space usage at creation. This check handles anything that slips
- // by, including internal usage. We allow a null color space here, for read/write pixels and
- // other special code paths. If a color space is provided, though, enforce all other rules.
- if (colorSpace && !SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
+ // by, including internal usage.
+ if (!SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
SkDEBUGFAIL("Invalid config and colorspace combination");
return nullptr;
}
@@ -497,9 +496,8 @@ sk_sp<GrTextureContext> GrDrawingManager::makeTextureContext(sk_sp<GrSurfaceProx
}
// SkSurface catches bad color space usage at creation. This check handles anything that slips
- // by, including internal usage. We allow a null color space here, for read/write pixels and
- // other special code paths. If a color space is provided, though, enforce all other rules.
- if (colorSpace && !SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
+ // by, including internal usage.
+ if (!SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
SkDEBUGFAIL("Invalid config and colorspace combination");
return nullptr;
}