diff options
author | caryclark <caryclark@google.com> | 2015-07-21 07:42:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 07:42:45 -0700 |
commit | 4ec1ac6a2dc7e43c4179638f3dd801be6f3b386e (patch) | |
tree | e2545dc1cbaf5354614148cf6560f0f8727c3122 /gm | |
parent | 9b8d3580c2a57ef6f788b1dc04b75106baf2e98a (diff) |
make xfermode* portable
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1243103002
Diffstat (limited to 'gm')
-rw-r--r-- | gm/xfermodeimagefilter.cpp | 6 | ||||
-rw-r--r-- | gm/xfermodes.cpp | 12 | ||||
-rw-r--r-- | gm/xfermodes2.cpp | 10 | ||||
-rw-r--r-- | gm/xfermodes3.cpp | 12 |
4 files changed, 21 insertions, 19 deletions
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp index 649e69f102..1ba1886533 100644 --- a/gm/xfermodeimagefilter.cpp +++ b/gm/xfermodeimagefilter.cpp @@ -35,7 +35,7 @@ protected: canvas.clear(0x00000000); SkPaint paint; paint.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&paint); + sk_tool_utils::set_portable_typeface_always(&paint); paint.setColor(0xD000D000); paint.setTextSize(SkIntToScalar(96)); const char* str = "e"; @@ -70,7 +70,9 @@ protected: fCheckerboard.allocN32Pixels(80, 80); SkCanvas checkerboardCanvas(fCheckerboard); - sk_tool_utils::draw_checkerboard(&checkerboardCanvas, 0xFFA0A0A0, 0xFF404040, 8); + sk_tool_utils::draw_checkerboard(&checkerboardCanvas, + sk_tool_utils::color_to_565(0xFFA0A0A0), + sk_tool_utils::color_to_565(0xFF404040), 8); } void onDraw(SkCanvas* canvas) override { diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp index 066ad5b695..93c8bf212c 100644 --- a/gm/xfermodes.cpp +++ b/gm/xfermodes.cpp @@ -26,7 +26,7 @@ static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst, { SkCanvas c(*src); - p.setColor(0xFFFFCC44); + p.setColor(sk_tool_utils::color_to_565(0xFFFFCC44)); r.set(0, 0, ww*3/4, hh*3/4); c.drawOval(r, p); } @@ -36,7 +36,7 @@ static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst, { SkCanvas c(*dst); - p.setColor(0xFF66AAFF); + p.setColor(sk_tool_utils::color_to_565(0xFF66AAFF)); r.set(ww/3, hh/3, ww*19/20, hh*19/20); c.drawRect(r, p); } @@ -106,11 +106,11 @@ class XfermodesGM : public GM { case kQuarterClear_SrcType: { SkScalar halfW = SkIntToScalar(W) / 2; SkScalar halfH = SkIntToScalar(H) / 2; - p.setColor(0xFF66AAFF); + p.setColor(sk_tool_utils::color_to_565(0xFF66AAFF)); SkRect r = SkRect::MakeXYWH(x + halfW, y, halfW, SkIntToScalar(H)); canvas->drawRect(r, p); - p.setColor(0xFFAA66FF); + p.setColor(sk_tool_utils::color_to_565(0xFFAA66FF)); r = SkRect::MakeXYWH(x, y + halfH, SkIntToScalar(W), halfH); canvas->drawRect(r, p); break; @@ -129,7 +129,7 @@ class XfermodesGM : public GM { SkScalar h = SkIntToScalar(H); SkRect r = SkRect::MakeXYWH(x + w / 3, y + h / 3, w * 37 / 60, h * 37 / 60); - p.setColor(0xFF66AAFF); + p.setColor(sk_tool_utils::color_to_565(0xFF66AAFF)); canvas->drawRect(r, p); break; } @@ -232,7 +232,7 @@ protected: SkPaint labelP; labelP.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&labelP); + sk_tool_utils::set_portable_typeface_always(&labelP); labelP.setTextAlign(SkPaint::kCenter_Align); const int W = 5; diff --git a/gm/xfermodes2.cpp b/gm/xfermodes2.cpp index 2ceb2fc650..ab57dcf703 100644 --- a/gm/xfermodes2.cpp +++ b/gm/xfermodes2.cpp @@ -34,7 +34,7 @@ protected: SkPaint labelP; labelP.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&labelP); + sk_tool_utils::set_portable_typeface_always(&labelP); labelP.setTextAlign(SkPaint::kCenter_Align); const int W = 6; @@ -88,10 +88,10 @@ protected: private: void onOnceBeforeDraw() override { static const uint32_t kCheckData[] = { - SkPackARGB32(0xFF, 0x40, 0x40, 0x40), - SkPackARGB32(0xFF, 0xD0, 0xD0, 0xD0), - SkPackARGB32(0xFF, 0xD0, 0xD0, 0xD0), - SkPackARGB32(0xFF, 0x40, 0x40, 0x40) + SkPackARGB32(0xFF, 0x42, 0x41, 0x42), + SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), + SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), + SkPackARGB32(0xFF, 0x42, 0x41, 0x42) }; SkBitmap bg; bg.allocN32Pixels(2, 2, true); diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp index 003b771e1f..d4659f0810 100644 --- a/gm/xfermodes3.cpp +++ b/gm/xfermodes3.cpp @@ -37,7 +37,7 @@ protected: void onDrawBackground(SkCanvas* canvas) override { SkPaint bgPaint; - bgPaint.setColor(0xFF70D0E0); + bgPaint.setColor(sk_tool_utils::color_to_565(0xFF70D0E0)); canvas->drawPaint(bgPaint); } @@ -46,7 +46,7 @@ protected: SkPaint labelP; labelP.setAntiAlias(true); - sk_tool_utils::set_portable_typeface(&labelP); + sk_tool_utils::set_portable_typeface_always(&labelP); static const SkColor kSolidColors[] = { SK_ColorTRANSPARENT, @@ -181,10 +181,10 @@ private: void onOnceBeforeDraw() override { static const uint32_t kCheckData[] = { - SkPackARGB32(0xFF, 0x40, 0x40, 0x40), - SkPackARGB32(0xFF, 0xD0, 0xD0, 0xD0), - SkPackARGB32(0xFF, 0xD0, 0xD0, 0xD0), - SkPackARGB32(0xFF, 0x40, 0x40, 0x40) + SkPackARGB32(0xFF, 0x42, 0x41, 0x42), + SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), + SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), + SkPackARGB32(0xFF, 0x42, 0x41, 0x42) }; SkBitmap bg; bg.allocN32Pixels(2, 2, true); |