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

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

Issue 20011: Improved OTR avatar and popup window rendering. (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
« no previous file with comments | « chrome/common/gfx/chrome_canvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/common/gfx/chrome_canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698