Chromium Code Reviews| 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 |