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

Unified Diff: skia/ext/skia_utils_gtk.cc

Issue 193032: Added ChromeOS settings for touchpad (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « chrome/common/pref_names.cc ('k') | views/controls/native_control_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_gtk.cc
===================================================================
--- skia/ext/skia_utils_gtk.cc (revision 26107)
+++ skia/ext/skia_utils_gtk.cc (working copy)
@@ -10,8 +10,13 @@
const int kSkiaToGDKMultiplier = 257;
+// GDK_COLOR_RGB multiplies by 257 (= 0x10001) to distribute the bits evenly
+// See: http://www.mindcontrol.org/~hplus/graphics/expand-bits.html
+// To get back, we can just right shift by eight
+// (or, formulated differently, i == (i*257)/256 for all i < 256).
+
SkColor GdkColorToSkColor(GdkColor color) {
- return SkColorSetRGB(color.red, color.green, color.blue);
+ return SkColorSetRGB(color.red >> 8, color.green >> 8, color.blue >> 8);
}
GdkColor SkColorToGdkColor(SkColor color) {
« no previous file with comments | « chrome/common/pref_names.cc ('k') | views/controls/native_control_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698