diff options
author | Mike Klein <mtklein@chromium.org> | 2018-06-05 15:11:11 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-06 20:35:24 +0000 |
commit | 6f02af9b54c28294363b5bde1f9c103fe0f054bc (patch) | |
tree | ea39c89e812c6ab9d4ad05cb2bdc86e298209bee /tests/AnimatedImageTest.cpp | |
parent | ece4306025dd0fc1754a58157dca7fef335a7ca0 (diff) |
remove linear-blended sRGB dst support in software
This is the mechanism we'd want to add back if we add an sRGBA
SkColorType. This will break the DM "srgb" config hard.
Landing this first should help flush out GMs that are incidentally using
sRGB offscreens.
Updated tests/AnimatedImageTest.cpp to avoid linear sRGB 8888 surfaces.
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Idb5035cf4d60fcd1dc24c303d43a406fc4a603fa
Reviewed-on: https://skia-review.googlesource.com/132261
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests/AnimatedImageTest.cpp')
-rw-r--r-- | tests/AnimatedImageTest.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/AnimatedImageTest.cpp b/tests/AnimatedImageTest.cpp index 13ea80804c..6532b58894 100644 --- a/tests/AnimatedImageTest.cpp +++ b/tests/AnimatedImageTest.cpp @@ -97,6 +97,17 @@ static bool compare_bitmaps(skiatest::Reporter* r, return true; } +// Temporary hack to avoid linear sRGB 8888 surfaces. +static SkImageInfo temporarily_sanitize(SkImageInfo info) { + if (info.colorType() == kRGBA_8888_SkColorType || + info.colorType() == kBGRA_8888_SkColorType) { + if (info.colorSpace() && info.colorSpace()->isSRGB()) { + info = info.makeColorSpace(nullptr); + } + } + return info; +} + DEF_TEST(AnimatedImage_copyOnWrite, r) { if (GetResourcePath().isEmpty()) { return; @@ -137,7 +148,7 @@ DEF_TEST(AnimatedImage_copyOnWrite, r) { std::vector<sk_sp<SkPicture>> pictures(frameCount); for (int i = 0; i < frameCount; i++) { SkBitmap& bm = expected[i]; - bm.allocPixels(imageInfo); + bm.allocPixels(temporarily_sanitize(imageInfo)); bm.eraseColor(SK_ColorTRANSPARENT); SkCanvas canvas(bm); @@ -157,7 +168,7 @@ DEF_TEST(AnimatedImage_copyOnWrite, r) { for (int i = 0; i < frameCount; i++) { SkBitmap test; - test.allocPixels(imageInfo); + test.allocPixels(temporarily_sanitize(imageInfo)); test.eraseColor(SK_ColorTRANSPARENT); SkCanvas canvas(test); @@ -237,7 +248,7 @@ DEF_TEST(AnimatedImage, r) { auto testDraw = [r, &frames, &imageInfo, file](const sk_sp<SkAnimatedImage>& animatedImage, int expectedFrame) { SkBitmap test; - test.allocPixels(imageInfo); + test.allocPixels(temporarily_sanitize(imageInfo)); test.eraseColor(0); SkCanvas c(test); animatedImage->draw(&c); |