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

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

Issue 385463002: Support FontRenderParams on Win; fix RenderTextHarfBuzz. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix header guards. Created 6 years, 5 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
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 <pango/pango.h> 8 #include <pango/pango.h>
9 #include <pango/pangocairo.h> 9 #include <pango/pangocairo.h>
10 #include <string> 10 #include <string>
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <map> 13 #include <map>
14 14
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
18 #include "ui/gfx/font_list.h" 18 #include "ui/gfx/font_list.h"
19 #include "ui/gfx/font_render_params_linux.h" 19 #include "ui/gfx/font_render_params.h"
20 #include "ui/gfx/text_utils.h" 20 #include "ui/gfx/text_utils.h"
21 21
22 namespace gfx { 22 namespace gfx {
23 23
24 namespace { 24 namespace {
25 25
26 // Marker for accelerators in the text. 26 // Marker for accelerators in the text.
27 const gunichar kAcceleratorChar = '&'; 27 const gunichar kAcceleratorChar = '&';
28 28
29 // Creates and returns a PangoContext. The caller owns the context. 29 // Creates and returns a PangoContext. The caller owns the context.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 if (i == desc_to_metrics->end()) { 262 if (i == desc_to_metrics->end()) {
263 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL); 263 PangoFontMetrics* metrics = pango_context_get_metrics(context, desc, NULL);
264 desc_to_metrics->insert(std::make_pair(desc_hash, metrics)); 264 desc_to_metrics->insert(std::make_pair(desc_hash, metrics));
265 return metrics; 265 return metrics;
266 } 266 }
267 return i->second; 267 return i->second;
268 } 268 }
269 269
270 } // namespace gfx 270 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698