summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 07:00:22 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 07:00:22 +0000
commit6e3b4dce8ae5a21fc2329bd611115363d21147ba (patch)
tree9dc0935522d29a63629d1bb30c062a71ba1fd6c8 /gfx
parent6a2fe92c213df4829fab5310b179b56ea134c8ab (diff)
downloadchromium_src-6e3b4dce8ae5a21fc2329bd611115363d21147ba.zip
chromium_src-6e3b4dce8ae5a21fc2329bd611115363d21147ba.tar.gz
chromium_src-6e3b4dce8ae5a21fc2329bd611115363d21147ba.tar.bz2
Revert 52441 - Revert Win specific elements of 46492 to look for perf impact
There was a regression in the moz page cycler around when landed. This was ONLY a single core regression, which suggests it was time spent in the browser becoming critical path. This change involved font layout in the browser, and so it MIGHT be related. I'll land this, let the per bots start their run, and then revert. TBR=pkasting Review URL: http://codereview.chromium.org/2895017 TBR=jar@chromium.org Review URL: http://codereview.chromium.org/3018001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r--gfx/font_win.cc15
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;
}