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

Unified Diff: ui/gfx/gtk_util.cc

Issue 7467007: Adding Wayland support for ui/gfx (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Adding missing WaylandDisplay include Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/gtk_util.h ('k') | ui/gfx/native_widget_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gtk_util.cc
diff --git a/ui/gfx/gtk_util.cc b/ui/gfx/gtk_util.cc
index b1c7f44ace9e418aa4a9b3017ff35d16b4d43077..fb5a31d2fac2f2085b4c83738a007c8f8cbb76ee 100644
--- a/ui/gfx/gtk_util.cc
+++ b/ui/gfx/gtk_util.cc
@@ -164,12 +164,22 @@ void SubtractRectanglesFromRegion(GdkRegion* region,
}
}
+PangoContext* GetPangoContext() {
+#if defined(USE_WAYLAND)
+ PangoFontMap* font_map = pango_cairo_font_map_get_default();
+ PangoContext* default_context = pango_font_map_create_context(font_map);
+#else
+ PangoContext* default_context = gdk_pango_context_get();
+#endif
+ return default_context;
+}
+
double GetPangoResolution() {
static double resolution;
static bool determined_resolution = false;
if (!determined_resolution) {
determined_resolution = true;
- PangoContext* default_context = gdk_pango_context_get();
+ PangoContext* default_context = GetPangoContext();
resolution = pango_cairo_context_get_resolution(default_context);
g_object_unref(default_context);
}
« no previous file with comments | « ui/gfx/gtk_util.h ('k') | ui/gfx/native_widget_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698