aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-15 09:29:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-15 09:29:32 -0700
commit3aaa0db1c4a3177cfe498012b2905dc3dfa92a6f (patch)
tree5fe0faf422a0efaf9bc2176b91662b1eef23408b
parentcae3ca65d2b3ae8c8c878ec860ea0620231af81a (diff)
make colorwheelnative displacement dropshadowimagefilter getposttextpath gm portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1237233004
-rw-r--r--gm/colorwheel.cpp4
-rw-r--r--gm/displacement.cpp7
-rw-r--r--gm/dropshadowimagefilter.cpp2
-rw-r--r--gm/getpostextpath.cpp2
4 files changed, 8 insertions, 7 deletions
diff --git a/gm/colorwheel.cpp b/gm/colorwheel.cpp
index 6b9c149684..f4542b3326 100644
--- a/gm/colorwheel.cpp
+++ b/gm/colorwheel.cpp
@@ -39,10 +39,10 @@ DEF_SIMPLE_GM(colorwheel, canvas, 256, 256) {
DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface_always(&paint, NULL, SkTypeface::kBold);
paint.setTextSize(18.0f);
- canvas->clear(SK_ColorLTGRAY);
+ canvas->clear(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
paint.setColor(SK_ColorRED);
canvas->drawText("R", 1, 8.0f, 20.0f, paint);
paint.setColor(SK_ColorGREEN);
diff --git a/gm/displacement.cpp b/gm/displacement.cpp
index 7b3d39c797..129682ddec 100644
--- a/gm/displacement.cpp
+++ b/gm/displacement.cpp
@@ -38,8 +38,8 @@ protected:
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
- paint.setColor(0xFF884422);
+ sk_tool_utils::set_portable_typeface_always(&paint);
+ paint.setColor(sk_tool_utils::color_to_565(0xFF884422));
paint.setTextSize(SkIntToScalar(96));
const char* str = "g";
canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55), paint);
@@ -48,7 +48,8 @@ protected:
void make_checkerboard(SkBitmap* bitmap, int w, int h) {
bitmap->allocN32Pixels(w, h);
SkCanvas canvas(*bitmap);
- sk_tool_utils::draw_checkerboard(&canvas, 0xFF244484, 0xFF804020, 8);
+ sk_tool_utils::draw_checkerboard(&canvas, sk_tool_utils::color_to_565(0xFF244484),
+ sk_tool_utils::color_to_565(0xFF804020), 8);
}
virtual SkISize onISize() {
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index e06264c9da..fd5f5839c6 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -39,7 +39,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->save();
diff --git a/gm/getpostextpath.cpp b/gm/getpostextpath.cpp
index 2286602aa7..bb641a06e8 100644
--- a/gm/getpostextpath.cpp
+++ b/gm/getpostextpath.cpp
@@ -39,7 +39,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(48));
canvas->translate(SkIntToScalar(10), SkIntToScalar(64));