From 7ab6a7f40b23610577bd64fbcb6121a2a715469b Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 25 Apr 2017 15:01:46 -0400 Subject: Fix writePixels of sRGB data to legacy GPU surface Adjusted unit test to verify this behavior. Bug: skia:6547 chromium:713632 chromium:713702 Change-Id: I6240937b2faf6ccb6adfc9477dc85ae961cdbbb7 Reviewed-on: https://skia-review.googlesource.com/14279 Commit-Queue: Brian Osman Reviewed-by: Brian Salomon --- tests/SRGBReadWritePixelsTest.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/SRGBReadWritePixelsTest.cpp') diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp index e3087e639e..9038b29770 100644 --- a/tests/SRGBReadWritePixelsTest.cpp +++ b/tests/SRGBReadWritePixelsTest.cpp @@ -225,11 +225,20 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { // Write srgba data to a rgba texture and read back as srgba and rgba if (sContext->writePixels(iiSRGBA, origData, 0, 0, 0)) { +#if 0 + // We don't support this conversion (read from untagged source into tagged destination. + // If we decide there is a meaningful way to implement this, restore this test. read_and_check_pixels(reporter, sContext.get(), origData, iiSRGBA, check_srgb_to_linear_to_srgb_conversion, error, "write/read srgba to rgba texture"); +#endif + // We expect the sRGB -> linear write to do no sRGB conversion (to match the behavior of + // drawing tagged sources). skbug.com/6547. So the data we read should still contain + // sRGB encoded values. + // + // srgb_to_linear_to_srgb is a proxy for the expected identity transform. read_and_check_pixels(reporter, sContext.get(), origData, iiRGBA, - check_srgb_to_linear_conversion, error, + check_srgb_to_linear_to_srgb_conversion, error, "write srgba/read rgba to rgba texture"); } else { ERRORF(reporter, "Could not write srgba data to rgba texture."); -- cgit v1.2.3