Index: tools/sk_tool_utils.cpp |
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp |
index 6fcd33751f3c8aa56dfe87d741c7b8265caa8f43..ec7942b165e7a77026c827320df3fc8c3ae16000 100644 |
--- a/tools/sk_tool_utils.cpp |
+++ b/tools/sk_tool_utils.cpp |
@@ -34,6 +34,12 @@ const char* colortype_name(SkColorType ct) { |
} |
} |
+void color_to_565(SkColor* color) { |
+ SkPMColor pmColor = SkPreMultiplyColor(*color); |
+ U16CPU color16 = SkPixel32ToPixel16(pmColor); |
+ *color = SkPixel16ToColor(color16); |
+} |
+ |
SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style) { |
SkTypeface* face; |
if (FLAGS_portableFonts) { |