| Index: chrome/common/gfx/chrome_canvas.cc
|
| ===================================================================
|
| --- chrome/common/gfx/chrome_canvas.cc (revision 9107)
|
| +++ chrome/common/gfx/chrome_canvas.cc (working copy)
|
| @@ -208,7 +208,12 @@
|
|
|
| void ChromeCanvas::TileImageInt(const SkBitmap& bitmap,
|
| int x, int y, int w, int h) {
|
| - if (!IntersectsClipRectInt(x, y, w, h))
|
| + TileImageInt(bitmap, 0, 0, x, y, w, h);
|
| +}
|
| +
|
| +void ChromeCanvas::TileImageInt(const SkBitmap& bitmap, int src_x, int src_y,
|
| + int dest_x, int dest_y, int w, int h) {
|
| + if (!IntersectsClipRectInt(dest_x, dest_y, w, h))
|
| return;
|
|
|
| SkPaint paint;
|
| @@ -223,8 +228,8 @@
|
| // need to unref after paint takes ownership of the shader.
|
| shader->unref();
|
| save();
|
| - translate(SkIntToScalar(x), SkIntToScalar(y));
|
| - ClipRectInt(0, 0, w, h);
|
| + translate(SkIntToScalar(dest_x - src_x), SkIntToScalar(dest_y - src_y));
|
| + ClipRectInt(src_x, src_y, w, h);
|
| drawPaint(paint);
|
| restore();
|
| }
|
|
|