Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: tools/sk_tool_utils.cpp

Issue 1182833004: make emptypath portable; add 565 color utility (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698