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

Side by Side Diff: chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h

Issue 2449243002: Gtk3 ui: Add libgtk3ui as a separate build component (Closed)
Patch Set: Add theme_properties dep to //chrome/browser/ui Created 4 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_SKIA_UTILS_GTK2_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_SKIA_UTILS_GTK2_H_
7
8 #include <stdint.h>
9
10 #include "third_party/skia/include/core/SkColor.h"
11
12 typedef struct _GdkColor GdkColor;
13 typedef struct _GdkPixbuf GdkPixbuf;
14
15 class SkBitmap;
16
17 // Define a macro for creating GdkColors from RGB values. This is a macro to
18 // allow static construction of literals, etc. Use this like:
19 // GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
20 #define GDK_COLOR_RGB(r, g, b) {0, r * ::libgtk2ui::kSkiaToGDKMultiplier, \
21 g * ::libgtk2ui::kSkiaToGDKMultiplier, \
22 b * ::libgtk2ui::kSkiaToGDKMultiplier}
23
24 namespace libgtk2ui {
25
26 // Multiply uint8_t color components by this.
27 const int kSkiaToGDKMultiplier = 257;
28
29 // Converts GdkColors to the ARGB layout Skia expects.
30 SkColor GdkColorToSkColor(GdkColor color);
31
32 // Converts ARGB to GdkColor.
33 GdkColor SkColorToGdkColor(SkColor color);
34
35 const SkBitmap GdkPixbufToImageSkia(GdkPixbuf* pixbuf);
36
37 // Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so
38 // it is an expensive operation. The returned GdkPixbuf will have a refcount of
39 // 1, and the caller is responsible for unrefing it when done.
40 GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
41
42 } // namespace libgtk2ui
43
44 #endif // CHROME_BROWSER_UI_LIBGTK2UI_SKIA_UTILS_GTK2_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/select_file_dialog_interactive_uitest.cc ('k') | chrome/browser/ui/libgtk2ui/skia_utils_gtk2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698