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

Side by Side Diff: base/gfx/gtk_util.h

Issue 43077: Add a GDK_COLOR_RGB macro for constructing GdkColors. (Closed)
Patch Set: Merge to trunk Created 11 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_GFX_GTK_UTIL_H_ 5 #ifndef BASE_GFX_GTK_UTIL_H_
6 #define BASE_GFX_GTK_UTIL_H_ 6 #define BASE_GFX_GTK_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 typedef struct _GdkPixbuf GdkPixbuf; 10 typedef struct _GdkPixbuf GdkPixbuf;
11 typedef struct _GdkRegion GdkRegion; 11 typedef struct _GdkRegion GdkRegion;
12 class SkBitmap; 12 class SkBitmap;
13 13
14 // Define a macro for creating GdkColors from RGB values. This is a macro to
15 // allow static construction of literals, etc. Use this like:
16 // GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
17 #define GDK_COLOR_RGB(r, g, b) {0, r * 257, g * 257, b * 257}
18
14 namespace gfx { 19 namespace gfx {
15 20
16 class Rect; 21 class Rect;
17 22
18 // Modify the given region by subtracting the given rectangles. 23 // Modify the given region by subtracting the given rectangles.
19 void SubtractRectanglesFromRegion(GdkRegion* region, 24 void SubtractRectanglesFromRegion(GdkRegion* region,
20 const std::vector<gfx::Rect>& cutouts); 25 const std::vector<gfx::Rect>& cutouts);
21 26
22 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: This is an expensive 27 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: This is an expensive
23 // operation, all of the pixels must be copied and their order swapped. 28 // operation, all of the pixels must be copied and their order swapped.
24 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); 29 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap);
25 30
26 } // namespace gfx 31 } // namespace gfx
27 32
28 #endif // BASE_GFX_GTK_UTIL_H_ 33 #endif // BASE_GFX_GTK_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698