summaryrefslogtreecommitdiffstats
path: root/gfx/canvas_linux.cc
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 04:14:42 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 04:14:42 +0000
commit450d54eceb47146fb4fd9af724a8589e0c1baa69 (patch)
tree86befc74041c9a77529d850fe640d903d4a263b6 /gfx/canvas_linux.cc
parent8a12e2bc1f606a0b8436d7498ec49751baff178f (diff)
downloadchromium_src-450d54eceb47146fb4fd9af724a8589e0c1baa69.zip
chromium_src-450d54eceb47146fb4fd9af724a8589e0c1baa69.tar.gz
chromium_src-450d54eceb47146fb4fd9af724a8589e0c1baa69.tar.bz2
Also set the canvas size. I missed this in the last patch.
BUG=26354 Review URL: http://codereview.chromium.org/1243001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/canvas_linux.cc')
-rw-r--r--gfx/canvas_linux.cc17
1 files changed, 2 insertions, 15 deletions
diff --git a/gfx/canvas_linux.cc b/gfx/canvas_linux.cc
index 0981d56..6bc7690 100644
--- a/gfx/canvas_linux.cc
+++ b/gfx/canvas_linux.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "gfx/font.h"
+#include "gfx/gtk_util.h"
#include "gfx/rect.h"
namespace {
@@ -22,20 +23,6 @@ const gunichar kAcceleratorChar = '&';
// DrawStringInt().
static cairo_font_options_t* cairo_font_options = NULL;
-// Returns the resolution used by pango. A negative values means the resolution
-// hasn't been set.
-static double GetPangoResolution() {
- static double resolution;
- static bool determined_resolution = false;
- if (!determined_resolution) {
- determined_resolution = true;
- PangoContext* default_context = gdk_pango_context_get();
- resolution = pango_cairo_context_get_resolution(default_context);
- g_object_unref(default_context);
- }
- return resolution;
-}
-
// Update |cairo_font_options| based on GtkSettings, allocating it if needed.
static void UpdateCairoFontOptions() {
if (!cairo_font_options)
@@ -155,7 +142,7 @@ static void SetupPangoLayout(PangoLayout* layout,
// Set the resolution to match that used by Gtk. If we don't set the
// resolution and the resolution differs from the default, Gtk and Chrome end
// up drawing at different sizes.
- double resolution = GetPangoResolution();
+ double resolution = gfx::GetPangoResolution();
if (resolution > 0) {
pango_cairo_context_set_resolution(pango_layout_get_context(layout),
resolution);