summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 00:12:41 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 00:12:41 +0000
commitd7cbf44926f66dde008ef8a6b8141ec8a774692c (patch)
tree63b5ff28ffe68ce4944f8412eb5aef100130f00d /chrome/views
parentc83f380110ae059934f0f50b2b0d305fff8f373b (diff)
downloadchromium_src-d7cbf44926f66dde008ef8a6b8141ec8a774692c.zip
chromium_src-d7cbf44926f66dde008ef8a6b8141ec8a774692c.tar.gz
chromium_src-d7cbf44926f66dde008ef8a6b8141ec8a774692c.tar.bz2
Remove the 0x0 canvas used for computing text sizes. Creating this is not necessary since the text can be sized using the desktop DC, which should be faster. I made this function static, and moved the functions it used into file-local functions since they didn't depend on the class either.
This is trying to fix bug 49. This code is very close to the crash, and a 0x0 canvas seems like it might cause problems. However, it is unclear whether this will have any effect (other than performance). Review URL: http://codereview.chromium.org/10409 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/label.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/chrome/views/label.cc b/chrome/views/label.cc
index ed8de0f..27f30d2 100644
--- a/chrome/views/label.cc
+++ b/chrome/views/label.cc
@@ -53,9 +53,8 @@ Label::~Label() {
gfx::Size Label::GetPreferredSize() {
gfx::Size prefsize;
if (is_multi_line_) {
- ChromeCanvas cc(0, 0, true);
int w = width(), h = 0;
- cc.SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags());
+ ChromeCanvas::SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags());
prefsize.SetSize(w, h);
} else {
prefsize = GetTextSize();