summaryrefslogtreecommitdiffstats
path: root/chrome/common/gfx
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 01:05:25 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 01:05:25 +0000
commitae760dca3c69caf48418c00d042df9969db3581c (patch)
tree3b573039efa9e841df1f68eecf9c22b4f9936549 /chrome/common/gfx
parentbb97536b768ac68fcbc4605c35461a798ef6e5ff (diff)
downloadchromium_src-ae760dca3c69caf48418c00d042df9969db3581c.zip
chromium_src-ae760dca3c69caf48418c00d042df9969db3581c.tar.gz
chromium_src-ae760dca3c69caf48418c00d042df9969db3581c.tar.bz2
Fix some problems with scaled icons. This allows the TabIconView to automatically scale the throbber and favicon to whatever size the View itself is. Notably, this does NOT change tab_renderer.cc, which _also_ draws favicons -- the former is used by app windows and the latter by standard tabs. Argh! I'm not going to bother unifying these for now even though it'd be nice, since we never scale up our tabs, just our app titlebars.
BUG=5054 Review URL: http://codereview.chromium.org/18392 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gfx')
-rw-r--r--chrome/common/gfx/chrome_canvas.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/common/gfx/chrome_canvas.cc b/chrome/common/gfx/chrome_canvas.cc
index 6734fda..66c9c66 100644
--- a/chrome/common/gfx/chrome_canvas.cc
+++ b/chrome/common/gfx/chrome_canvas.cc
@@ -189,11 +189,10 @@ void ChromeCanvas::DrawBitmapInt(const SkBitmap& bitmap, int src_x, int src_y,
SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode);
SkMatrix shader_scale;
- shader_scale.setScale(
- SkFloatToScalar(static_cast<float>(dest_w) / src_w),
- SkFloatToScalar(static_cast<float>(dest_h) / src_h));
- shader_scale.postTranslate(SkIntToScalar(dest_x - src_x),
- SkIntToScalar(dest_y - src_y));
+ shader_scale.setScale(SkFloatToScalar(static_cast<float>(dest_w) / src_w),
+ SkFloatToScalar(static_cast<float>(dest_h) / src_h));
+ shader_scale.preTranslate(SkIntToScalar(-src_x), SkIntToScalar(-src_y));
+ shader_scale.postTranslate(SkIntToScalar(dest_x), SkIntToScalar(dest_y));
shader->setLocalMatrix(shader_scale);
// Set up our paint to use the shader & release our reference (now just owned