Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1060)

Unified Diff: chrome/common/gfx/chrome_canvas.cc

Issue 18392: Fix some problems with scaled icons. This allows the TabIconView to automati... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/gfx/chrome_canvas.cc
===================================================================
--- chrome/common/gfx/chrome_canvas.cc (revision 8058)
+++ chrome/common/gfx/chrome_canvas.cc (working copy)
@@ -189,11 +189,10 @@
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));
sky 2009/01/21 00:53:22 I've no idea on this code, I'm assuming you know w
Peter Kasting 2009/01/21 01:00:36 Pre-translate means "do this before the existing m
shader->setLocalMatrix(shader_scale);
// Set up our paint to use the shader & release our reference (now just owned
« chrome/browser/views/tab_icon_view.cc ('K') | « chrome/browser/views/tabs/tab_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698