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

Side by Side Diff: ui/gfx/pango_util.cc

Issue 10009024: Remove WAYLAND port (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/native_widget_types.h ('k') | ui/gfx/platform_font_pango.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) 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 #include "ui/gfx/pango_util.h" 5 #include "ui/gfx/pango_util.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <pango/pango.h> 9 #include <pango/pango.h>
10 #include <pango/pangocairo.h> 10 #include <pango/pangocairo.h>
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <map> 13 #include <map>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "ui/gfx/canvas.h" 18 #include "ui/gfx/canvas.h"
19 #include "ui/gfx/font.h" 19 #include "ui/gfx/font.h"
20 #include "ui/gfx/platform_font_pango.h" 20 #include "ui/gfx/platform_font_pango.h"
21 #include "ui/gfx/rect.h" 21 #include "ui/gfx/rect.h"
22 22
23 #if !defined(USE_WAYLAND) && defined(TOOLKIT_GTK) 23 #if defined(TOOLKIT_GTK)
24 #include <gdk/gdk.h> 24 #include <gdk/gdk.h>
25 #include <gtk/gtk.h> 25 #include <gtk/gtk.h>
26 #include "ui/gfx/gtk_util.h" 26 #include "ui/gfx/gtk_util.h"
27 #endif 27 #endif
28 28
29 #include "ui/gfx/skia_util.h" 29 #include "ui/gfx/skia_util.h"
30 30
31 namespace { 31 namespace {
32 32
33 // Marker for accelerators in the text. 33 // Marker for accelerators in the text.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 return pixels_in_point; 174 return pixels_in_point;
175 } 175 }
176 176
177 } // namespace 177 } // namespace
178 178
179 namespace gfx { 179 namespace gfx {
180 180
181 PangoContext* GetPangoContext() { 181 PangoContext* GetPangoContext() {
182 #if defined(USE_WAYLAND) || defined(USE_AURA) 182 #if defined(USE_AURA)
183 PangoFontMap* font_map = pango_cairo_font_map_get_default(); 183 PangoFontMap* font_map = pango_cairo_font_map_get_default();
184 return pango_font_map_create_context(font_map); 184 return pango_font_map_create_context(font_map);
185 #else 185 #else
186 return gdk_pango_context_get(); 186 return gdk_pango_context_get();
187 #endif 187 #endif
188 } 188 }
189 189
190 double GetPangoResolution() { 190 double GetPangoResolution() {
191 static double resolution; 191 static double resolution;
192 static bool determined_resolution = false; 192 static bool determined_resolution = false;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 480
481 if (i == desc_to_metrics->end()) { 481 if (i == desc_to_metrics->end()) {
482 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL); 482 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL);
483 desc_to_metrics->insert(std::make_pair(desc_hash, metrics)); 483 desc_to_metrics->insert(std::make_pair(desc_hash, metrics));
484 return metrics; 484 return metrics;
485 } 485 }
486 return i->second; 486 return i->second;
487 } 487 }
488 488
489 } // namespace gfx 489 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/native_widget_types.h ('k') | ui/gfx/platform_font_pango.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698