Use a black background in imagefiltersgraph so 8888 and 565 look similar.

BUG=skia:

Review URL: https://codereview.chromium.org/1041773003
This commit is contained in:
mtklein 2015-03-27 12:33:46 -07:00 committed by Commit bot
parent d588c01c7e
commit 871ad7a13e

View File

@ -110,11 +110,11 @@ protected:
void make_bitmap() { void make_bitmap() {
fBitmap.allocN32Pixels(100, 100); fBitmap.allocN32Pixels(100, 100);
SkCanvas canvas(fBitmap); SkCanvas canvas(fBitmap);
canvas.clear(0x00000000); canvas.clear(SK_ColorTRANSPARENT);
SkPaint paint; SkPaint paint;
paint.setAntiAlias(true); paint.setAntiAlias(true);
sk_tool_utils::set_portable_typeface(&paint); sk_tool_utils::set_portable_typeface(&paint);
paint.setColor(0xFFFFFFFF); paint.setColor(SK_ColorWHITE);
paint.setTextSize(SkIntToScalar(96)); paint.setTextSize(SkIntToScalar(96));
const char* str = "e"; const char* str = "e";
canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
@ -135,7 +135,7 @@ protected:
} }
virtual void onDraw(SkCanvas* canvas) { virtual void onDraw(SkCanvas* canvas) {
canvas->clear(0x00000000); canvas->clear(SK_ColorBLACK);
{ {
SkAutoTUnref<SkImageFilter> bitmapSource(SkBitmapSource::Create(fBitmap)); SkAutoTUnref<SkImageFilter> bitmapSource(SkBitmapSource::Create(fBitmap));
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED, SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED,
@ -216,7 +216,7 @@ protected:
SkPaint paint; SkPaint paint;
paint.setImageFilter(color2); paint.setImageFilter(color2);
paint.setColor(0xFFFF0000); paint.setColor(SK_ColorRED);
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), paint); canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), paint);
canvas->translate(SkIntToScalar(100), 0); canvas->translate(SkIntToScalar(100), 0);
} }