Index: gm/xfermodeimagefilter.cpp |
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp |
index 80994a6ed8016124dfa25f1706307884b9c5f38b..e09c0abe944b9763dda29ec23bb2cd8d3d019b23 100644 |
--- a/gm/xfermodeimagefilter.cpp |
+++ b/gm/xfermodeimagefilter.cpp |
@@ -29,19 +29,6 @@ protected: |
return SkString("xfermodeimagefilter"); |
} |
- void make_bitmap() { |
- fBitmap.allocN32Pixels(80, 80); |
- SkCanvas canvas(fBitmap); |
- canvas.clear(0x00000000); |
- SkPaint paint; |
- paint.setAntiAlias(true); |
- sk_tool_utils::set_portable_typeface(&paint); |
- paint.setColor(0xD000D000); |
- paint.setTextSize(SkIntToScalar(96)); |
- const char* str = "e"; |
- canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(65), paint); |
- } |
- |
SkISize onISize() override { |
return SkISize::Make(WIDTH, HEIGHT); |
} |
@@ -66,13 +53,13 @@ protected: |
} |
void onOnceBeforeDraw() override { |
- make_bitmap(); |
+ fBitmap = sk_tool_utils::create_string_bitmap(80, 80, 0xD000D000, 15, 65, 96, "e"); |
- fCheckerboard.allocN32Pixels(80, 80); |
- SkCanvas checkerboardCanvas(fCheckerboard); |
- sk_tool_utils::draw_checkerboard(&checkerboardCanvas, |
- sk_tool_utils::color_to_565(0xFFA0A0A0), |
- sk_tool_utils::color_to_565(0xFF404040), 8); |
+ fCheckerboard = sk_tool_utils::create_checkerboard_bitmap( |
+ 80, 80, |
+ sk_tool_utils::color_to_565(0xFFA0A0A0), |
+ sk_tool_utils::color_to_565(0xFF404040), |
+ 8); |
} |
void onDraw(SkCanvas* canvas) override { |