From aad8b27ec6ff93b64f458be78a3eff7e91b10e15 Mon Sep 17 00:00:00 2001 From: senorblanco Date: Wed, 8 Apr 2015 12:36:08 -0700 Subject: [PATCH] Use opaque black not transparent black as imagefilter GM background. For some reason, GM's are now being composited against white in some modes, where the alpha used to be ignored (or composited against black, I'm not sure which). At any rate, it doesn't make much sense to have alpha in the result anyway, so let's clear to opaque black instead of transparent black and avoid the problem. This is a trial balloon for bitmapsource and pictureimagefilter. If all goes well, I'll make this change more widely. R=scroggo BUG=skia:3319 Review URL: https://codereview.chromium.org/1074513002 --- gm/bitmapsource.cpp | 2 +- gm/pictureimagefilter.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gm/bitmapsource.cpp b/gm/bitmapsource.cpp index d59524f..a0a3eca 100644 --- a/gm/bitmapsource.cpp +++ b/gm/bitmapsource.cpp @@ -50,7 +50,7 @@ protected: } void onDraw(SkCanvas* canvas) override { - canvas->clear(0x00000000); + canvas->clear(SK_ColorBLACK); { SkRect srcRect = SkRect::MakeXYWH(20, 20, 30, 30); SkRect dstRect = SkRect::MakeXYWH(0, 10, 60, 60); diff --git a/gm/pictureimagefilter.cpp b/gm/pictureimagefilter.cpp index a4cb6b3..fd8ae62 100644 --- a/gm/pictureimagefilter.cpp +++ b/gm/pictureimagefilter.cpp @@ -25,7 +25,7 @@ protected: void makePicture() { SkPictureRecorder recorder; SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0); - canvas->clear(0x00000000); + canvas->clear(SK_ColorBLACK); SkPaint paint; paint.setAntiAlias(true); sk_tool_utils::set_portable_typeface(&paint); @@ -52,7 +52,7 @@ protected: } void onDraw(SkCanvas* canvas) override { - canvas->clear(0x00000000); + canvas->clear(SK_ColorBLACK); { SkRect srcRect = SkRect::MakeXYWH(20, 20, 30, 30); SkRect emptyRect = SkRect::MakeXYWH(20, 20, 0, 0); -- 2.7.4