summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 20:21:53 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 20:21:53 +0000
commit2627431bef905332e55a90960aed8049b681689f (patch)
tree4d15c42eb95a48241e2bc9a109bbb77c3eafad00 /skia
parentd328413b739ed1150369743a64cacfb167086a32 (diff)
downloadchromium_src-2627431bef905332e55a90960aed8049b681689f.zip
chromium_src-2627431bef905332e55a90960aed8049b681689f.tar.gz
chromium_src-2627431bef905332e55a90960aed8049b681689f.tar.bz2
Lands http://codereview.chromium.org/193032 for Charlie:
First pass at adding ChromeOS settings - a mock wifi selector combobox - touchpad settings that makes calls to synclient - on startup, touchpad settings are initialized to what's stored in preferences TEST=none BUG=none Review URL: http://codereview.chromium.org/203073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/skia_utils_gtk.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/skia/ext/skia_utils_gtk.cc b/skia/ext/skia_utils_gtk.cc
index 7989019..da56374 100644
--- a/skia/ext/skia_utils_gtk.cc
+++ b/skia/ext/skia_utils_gtk.cc
@@ -10,8 +10,13 @@ namespace skia {
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) {