diff options
author | caryclark <caryclark@google.com> | 2015-06-15 05:09:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-15 05:09:59 -0700 |
commit | be7f768a357aefb39c42d24b81b24d647bb6ab70 (patch) | |
tree | a5897bcb5ce6dc995cf0cfea5e72a989cc2d16a1 /tools/sk_tool_utils.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 'tools/sk_tool_utils.cpp')
-rw-r--r-- | tools/sk_tool_utils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp index ec7942b165..4d0e0bde68 100644 --- a/tools/sk_tool_utils.cpp +++ b/tools/sk_tool_utils.cpp @@ -34,10 +34,10 @@ const char* colortype_name(SkColorType ct) { } } -void color_to_565(SkColor* color) { - SkPMColor pmColor = SkPreMultiplyColor(*color); +SkColor color_to_565(SkColor color) { + SkPMColor pmColor = SkPreMultiplyColor(color); U16CPU color16 = SkPixel32ToPixel16(pmColor); - *color = SkPixel16ToColor(color16); + return SkPixel16ToColor(color16); } SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style) { |