OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_GTK_UTIL_H_ | 5 #ifndef UI_GFX_GTK_UTIL_H_ |
6 #define UI_GFX_GTK_UTIL_H_ | 6 #define UI_GFX_GTK_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Call gtk_init() / gdk_init() using the argc and argv from command_line. | 24 // Call gtk_init() / gdk_init() using the argc and argv from command_line. |
25 // These init functions want an argc and argv that they can mutate; we provide | 25 // These init functions want an argc and argv that they can mutate; we provide |
26 // those, but leave the original CommandLine unaltered. | 26 // those, but leave the original CommandLine unaltered. |
27 UI_EXPORT void GtkInitFromCommandLine(const CommandLine& command_line); | 27 UI_EXPORT void GtkInitFromCommandLine(const CommandLine& command_line); |
28 UI_EXPORT void GdkInitFromCommandLine(const CommandLine& command_line); | 28 UI_EXPORT void GdkInitFromCommandLine(const CommandLine& command_line); |
29 | 29 |
30 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so | 30 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so |
31 // it is an expensive operation. The returned GdkPixbuf will have a refcount of | 31 // it is an expensive operation. The returned GdkPixbuf will have a refcount of |
32 // 1, and the caller is responsible for unrefing it when done. | 32 // 1, and the caller is responsible for unrefing it when done. |
33 UI_EXPORT GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); | 33 UI_EXPORT GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap); |
34 | 34 |
35 // Modify the given region by subtracting the given rectangles. | 35 // Modify the given region by subtracting the given rectangles. |
36 UI_EXPORT void SubtractRectanglesFromRegion(GdkRegion* region, | 36 UI_EXPORT void SubtractRectanglesFromRegion(GdkRegion* region, |
37 const std::vector<Rect>& cutouts); | 37 const std::vector<Rect>& cutouts); |
38 | 38 |
39 // Returns a static instance of a GdkCursor* object, sharable across the | 39 // Returns a static instance of a GdkCursor* object, sharable across the |
40 // process. Caller must gdk_cursor_ref() it if they want to assume ownership. | 40 // process. Caller must gdk_cursor_ref() it if they want to assume ownership. |
41 UI_EXPORT GdkCursor* GetCursor(int type); | 41 UI_EXPORT GdkCursor* GetCursor(int type); |
42 | 42 |
43 // Initialize some GTK settings so that our dialogs are consistent. | 43 // Initialize some GTK settings so that our dialogs are consistent. |
44 UI_EXPORT void InitRCStyles(); | 44 UI_EXPORT void InitRCStyles(); |
45 | 45 |
46 } // namespace gfx | 46 } // namespace gfx |
47 | 47 |
48 #endif // UI_GFX_GTK_UTIL_H_ | 48 #endif // UI_GFX_GTK_UTIL_H_ |
OLD | NEW |