diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 00:12:29 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 00:12:29 +0000 |
commit | b19117df31ce9b72e7776ee82287bd582d69c57e (patch) | |
tree | 6239988e826cac910e9700d18eadc651a21d51b0 /gfx | |
parent | 8314cc5be9d5237e22f953ce1f42fb05903af6a8 (diff) | |
download | chromium_src-b19117df31ce9b72e7776ee82287bd582d69c57e.zip chromium_src-b19117df31ce9b72e7776ee82287bd582d69c57e.tar.gz chromium_src-b19117df31ce9b72e7776ee82287bd582d69c57e.tar.bz2 |
Attempt to reland code reverted in r52599, to take another look at the page cycler data. There was a lot of noise in the previous data, and since the current page cycler t and t_ref times are close, I'm hoping to see something more conclusive.
TBR=jar
BUG=47227
TEST=none
Review URL: http://codereview.chromium.org/3026032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/font_win.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/gfx/font_win.cc b/gfx/font_win.cc index 5660cc7..f9b7243 100644 --- a/gfx/font_win.cc +++ b/gfx/font_win.cc @@ -170,18 +170,9 @@ Font Font::DeriveFont(int size_delta, int style) const { } int Font::GetStringWidth(const std::wstring& text) const { - int width = 0; - HDC dc = GetDC(NULL); - HFONT previous_font = static_cast<HFONT>(SelectObject(dc, hfont())); - SIZE size; - if (GetTextExtentPoint32(dc, text.c_str(), static_cast<int>(text.size()), - &size)) { - width = size.cx; - } else { - width = 0; - } - SelectObject(dc, previous_font); - ReleaseDC(NULL, dc); + int width = 0, height = 0; + CanvasSkia::SizeStringInt(text, *this, &width, &height, + gfx::Canvas::NO_ELLIPSIS); return width; } |