From d16084ffdc688bad6d0e9c04f3f98049b3412633 Mon Sep 17 00:00:00 2001 From: Matt Sarett Date: Fri, 26 May 2017 11:40:25 -0400 Subject: Better image for copyTo4444 test This one produces noticeable differences if we fail to dither. Bug:720105 Change-Id: I208d0c8147f4cca1b484f2f55edc09ce1bef2dcb Reviewed-on: https://skia-review.googlesource.com/18036 Commit-Queue: Mike Klein Reviewed-by: Mike Klein --- gm/copyTo4444.cpp | 6 ++++-- resources/dog.jpg | Bin 0 -> 8504 bytes 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 resources/dog.jpg diff --git a/gm/copyTo4444.cpp b/gm/copyTo4444.cpp index f593a19de8..97e6f0a0db 100644 --- a/gm/copyTo4444.cpp +++ b/gm/copyTo4444.cpp @@ -27,17 +27,19 @@ protected: } virtual SkISize onISize() { - return SkISize::Make(1024, 512); + return SkISize::Make(360, 180); } virtual void onDraw(SkCanvas* canvas) { SkBitmap bm, bm4444; - if (!GetResourceAsBitmap("mandrill_512.png", &bm)) { + if (!GetResourceAsBitmap("dog.jpg", &bm)) { SkDebugf("Could not decode the file. Did you forget to set the " "resourcePath?\n"); return; } canvas->drawBitmap(bm, 0, 0); + + // This should dither or we will see artifacts in the background of the image. SkAssertResult(sk_tool_utils::copy_to(&bm4444, kARGB_4444_SkColorType, bm)); canvas->drawBitmap(bm4444, SkIntToScalar(bm.width()), 0); } diff --git a/resources/dog.jpg b/resources/dog.jpg new file mode 100644 index 0000000000..2598ecb8b7 Binary files /dev/null and b/resources/dog.jpg differ -- cgit v1.2.3