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

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

Issue 18804: OpaqueNonClientView cleanup (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') | chrome/views/custom_frame_window.cc » ('j') | 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 8638)
+++ chrome/common/gfx/chrome_canvas.cc (working copy)
@@ -207,9 +207,13 @@
}
void ChromeCanvas::TileImageInt(const SkBitmap& bitmap,
- int x, int y, int w, int h,
- SkPorterDuff::Mode mode) {
- if (!IntersectsClipRectInt(x, y, w, h))
+ int x, int y, int w, int 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;
@@ -218,23 +222,18 @@
SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode);
paint.setShader(shader);
- paint.setPorterDuffXfermode(mode);
+ paint.setPorterDuffXfermode(SkPorterDuff::kSrcOver_Mode);
// CreateBitmapShader returns a Shader with a reference count of one, we
// 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();
}
-void ChromeCanvas::TileImageInt(const SkBitmap& bitmap,
- int x, int y, int w, int h) {
- TileImageInt(bitmap, x, y, w, h, SkPorterDuff::kSrcOver_Mode);
-}
-
SkBitmap ChromeCanvas::ExtractBitmap() {
const SkBitmap& device_bitmap = getDevice()->accessBitmap(false);
« no previous file with comments | « chrome/common/gfx/chrome_canvas.h ('k') | chrome/views/custom_frame_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698