diff options
author | 2015-06-15 05:09:59 -0700 | |
---|---|---|
committer | 2015-06-15 05:09:59 -0700 | |
commit | be7f768a357aefb39c42d24b81b24d647bb6ab70 (patch) | |
tree | a5897bcb5ce6dc995cf0cfea5e72a989cc2d16a1 /gm/filterbitmap.cpp | |
parent | b5b50a07abb454abaf6ab46db20c6db6f5ecf9f6 (diff) |
make gm background colors 565 compatible
Change a batch of GM tests to convert their background color
so that it is representable in 8888 and 565.
Enable portable text in those same tests to minimize platform
differences.
In a couple of bitmap tests, use portable typefaces instead of
choosing 'Times' which may or may not be available on the platform.
R=borenet@google.com
Review URL: https://codereview.chromium.org/1176243006
Diffstat (limited to 'gm/filterbitmap.cpp')
-rw-r--r-- | gm/filterbitmap.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp index 7d7c40ff50..d7194c096d 100644 --- a/gm/filterbitmap.cpp +++ b/gm/filterbitmap.cpp @@ -14,7 +14,7 @@ #include "SkTypeface.h" static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) { - sk_tool_utils::set_portable_typeface(paint, name, style); + sk_tool_utils::set_portable_typeface_always(paint, name, style); } static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) { @@ -66,7 +66,7 @@ public: FilterBitmapGM() { - this->setBGColor(0xFFDDDDDD); + this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); } protected: @@ -124,13 +124,13 @@ class FilterBitmapTextGM: public FilterBitmapGM { paint.setSubpixelText(true); paint.setTextSize(fTextSize); - setTypeface(&paint, "Times", SkTypeface::kNormal); + setTypeface(&paint, "serif", SkTypeface::kNormal); canvas.drawText("Hamburgefons", 12, fTextSize/2, 1.2f*fTextSize, paint); - setTypeface(&paint, "Times", SkTypeface::kBold); + setTypeface(&paint, "serif", SkTypeface::kBold); canvas.drawText("Hamburgefons", 12, fTextSize/2, 2.4f*fTextSize, paint); - setTypeface(&paint, "Times", SkTypeface::kItalic); + setTypeface(&paint, "serif", SkTypeface::kItalic); canvas.drawText("Hamburgefons", 12, fTextSize/2, 3.6f*fTextSize, paint); - setTypeface(&paint, "Times", SkTypeface::kBoldItalic); + setTypeface(&paint, "serif", SkTypeface::kBoldItalic); canvas.drawText("Hamburgefons", 12, fTextSize/2, 4.8f*fTextSize, paint); } private: |