OLD | NEW |
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 _GdkRegion GdkRegion; | 11 typedef struct _GdkRegion GdkRegion; |
11 | 12 |
12 namespace gfx { | 13 namespace gfx { |
13 | 14 |
14 class Rect; | 15 class Rect; |
15 | 16 |
16 // Modify the given region by subtracting the given rectangles. | 17 // Modify the given region by subtracting the given rectangles. |
17 void SubtractRectanglesFromRegion(GdkRegion* region, | 18 void SubtractRectanglesFromRegion(GdkRegion* region, |
18 const std::vector<gfx::Rect>& cutouts); | 19 const std::vector<gfx::Rect>& cutouts); |
19 | 20 |
| 21 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: This is an expensive |
| 22 // operation, all of the pixels must be copied and their order swapped. |
| 23 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); |
| 24 |
20 } // namespace gfx | 25 } // namespace gfx |
21 | 26 |
22 #endif // BASE_GFX_GTK_UTIL_H_ | 27 #endif // BASE_GFX_GTK_UTIL_H_ |
OLD | NEW |