aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-02 15:21:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-02 20:13:52 +0000
commit9aa30c6ee0e5e2ba4ccc25a4913966a65f808f28 (patch)
tree51a77c3460dbb9237fb504ad971c36d2633c4d76 /src/image
parent2f046f1f526715f2c2179e825529770fae5ff078 (diff)
Remove sRGB config checks based on color space
All of the restrictions/assumptions that led to this code are gone, so we can always use appropriate color space. For the YUV provider, if/when we re-introduce 8888 sRGB, the color space will have a linear transfer function, so the color space xform will automatically do what was happening here. That removes the last usage of framebuffer sRGB control, so we can remove all kinds of GrPaint and GrPipeline plumbing for that feature. Change-Id: I24af1d498dbc75210f92f8c61b10aa31eec022f6 Reviewed-on: https://skia-review.googlesource.com/138986 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage_Gpu.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 8a7a789ec9..1a89ba42ae 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -230,29 +230,8 @@ bool SkImage_Gpu::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size
flags = GrContextPriv::kUnpremul_PixelOpsFlag;
}
- // This hack allows us to call makeNonTextureImage on images with arbitrary color spaces.
- // Otherwise, we'll be unable to create a render target context.
- // TODO: This shouldn't be necessary - we need more robust support for images (and surfaces)
- // with arbitrary color spaces. Unfortunately, this is one spot where we go from image to
- // surface (rather than the opposite), and our lenient image rules break our (currently) more
- // strict surface rules.
- // GrSurfaceContext::readPixels does not make use of the context's color space. However, we
- // don't allow creating a surface context for a sRGB GrPixelConfig unless the color space has
- // sRGB gamma. So we choose null for non-SRGB GrPixelConfigs and sRGB for sRGB GrPixelConfigs.
- sk_sp<SkColorSpace> surfaceColorSpace = fColorSpace;
- if (!flags) {
- if (!dstInfo.colorSpace() ||
- SkColorSpace::Equals(fColorSpace.get(), dstInfo.colorSpace())) {
- if (GrPixelConfigIsSRGB(fProxy->config())) {
- surfaceColorSpace = SkColorSpace::MakeSRGB();
- } else {
- surfaceColorSpace = nullptr;
- }
- }
- }
-
sk_sp<GrSurfaceContext> sContext = fContext->contextPriv().makeWrappedSurfaceContext(
- fProxy, surfaceColorSpace);
+ fProxy, fColorSpace);
if (!sContext) {
return false;
}