summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 11:13:38 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 11:13:38 +0000
commit739c52198933941ad2602533d7dc271a2854b600 (patch)
treed42f8533802135e3d6958a5ee7444b7c8e8cbd5e /base
parentc504b3a4fa4c63c3638de53fbeb87cf057d038e4 (diff)
downloadchromium_src-739c52198933941ad2602533d7dc271a2854b600.zip
chromium_src-739c52198933941ad2602533d7dc271a2854b600.tar.gz
chromium_src-739c52198933941ad2602533d7dc271a2854b600.tar.bz2
Add a GDK_COLOR_RGB macro for constructing GdkColors.
This does the simple math of * 257 to map from a 1 byte component to the gint16 GdkColor values, and initializes the pixel field to 0. Review URL: http://codereview.chromium.org/43077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rwxr-xr-xbase/gfx/gtk_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/base/gfx/gtk_util.h b/base/gfx/gtk_util.h
index bf6e6aa..40a7855 100755
--- a/base/gfx/gtk_util.h
+++ b/base/gfx/gtk_util.h
@@ -11,6 +11,11 @@ typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
class SkBitmap;
+// Define a macro for creating GdkColors from RGB values. This is a macro to
+// allow static construction of literals, etc. Use this like:
+// GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
+#define GDK_COLOR_RGB(r, g, b) {0, r * 257, g * 257, b * 257}
+
namespace gfx {
class Rect;