From ce4cf72e3487f661e53f6d0c3416c9b58da4fd00 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 10 May 2018 11:29:15 -0400 Subject: non-linear blending first steps Code: - Add a non-linear blending bit and makeNonlinearBlending() to SkColorSpace - remove enough F16=linear checks to make it possible to create surfaces and encode pngs with nonlinear F16 Testing: - add "esrgb" software config to DM, run it - add "srgbnl" software config, run it - deemphasize importance of "srgb" config on bots - update unit tests to reflect relaxed F16 constraints - add a new unit test file with _really_ basic tests, and a new unit test that's not working yet Bug: skia:7942 Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83 Reviewed-on: https://skia-review.googlesource.com/127325 Reviewed-by: Brian Osman Commit-Queue: Mike Klein --- src/image/SkSurface_Gpu.cpp | 4 ++-- src/image/SkSurface_Raster.cpp | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/image') diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index b646f9e506..d86b316ef6 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -271,7 +271,7 @@ bool SkSurface_Gpu::onDraw(const SkDeferredDisplayList* ddl) { bool SkSurface_Gpu::Valid(const SkImageInfo& info) { switch (info.colorType()) { case kRGBA_F16_SkColorType: - return (!info.colorSpace()) || info.colorSpace()->gammaIsLinear(); + return true; case kRGBA_8888_SkColorType: case kBGRA_8888_SkColorType: return !info.colorSpace() || info.colorSpace()->gammaCloseToSRGB(); @@ -283,7 +283,7 @@ bool SkSurface_Gpu::Valid(const SkImageInfo& info) { bool SkSurface_Gpu::Valid(const GrCaps* caps, GrPixelConfig config, SkColorSpace* colorSpace) { switch (config) { case kRGBA_half_GrPixelConfig: - return (!colorSpace) || colorSpace->gammaIsLinear(); + return true; case kSRGBA_8888_GrPixelConfig: case kSBGRA_8888_GrPixelConfig: return caps->srgbSupport() && colorSpace && colorSpace->gammaCloseToSRGB(); diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp index 47d5542ac6..fd120072f4 100644 --- a/src/image/SkSurface_Raster.cpp +++ b/src/image/SkSurface_Raster.cpp @@ -68,9 +68,6 @@ bool SkSurfaceValidateRasterInfo(const SkImageInfo& info, size_t rowBytes) { } break; case kRGBA_F16_SkColorType: - if (info.colorSpace() && (!info.colorSpace()->gammaIsLinear())) { - return false; - } break; default: return false; -- cgit v1.2.3