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

Unified Diff: ui/gfx/canvas_skia.cc

Issue 8383028: ui/gfx: Convert Canvas::ClipRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 9 years, 2 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 | « ui/gfx/canvas_skia.h ('k') | ui/gfx/canvas_skia_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia.cc
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index 4e481ef43be1ba4b992551d97c2dc93861b7e013..bf874346fbd8412a872b17c3132476605d824f8a 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -12,6 +12,7 @@
#include "ui/gfx/brush.h"
#include "ui/gfx/font.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/skia_util.h"
#include "ui/gfx/transform.h"
#if defined(OS_WIN)
@@ -109,11 +110,8 @@ void CanvasSkia::Restore() {
canvas_->restore();
}
-bool CanvasSkia::ClipRectInt(int x, int y, int w, int h) {
- SkRect new_clip;
- new_clip.set(SkIntToScalar(x), SkIntToScalar(y),
- SkIntToScalar(x + w), SkIntToScalar(y + h));
- return canvas_->clipRect(new_clip);
+bool CanvasSkia::ClipRectInt(const gfx::Rect& rect) {
+ return canvas_->clipRect(gfx::RectToSkRect(rect));
}
void CanvasSkia::TranslateInt(int x, int y) {
@@ -336,7 +334,7 @@ void CanvasSkia::TileImageInt(const SkBitmap& bitmap,
canvas_->save();
canvas_->translate(SkIntToScalar(dest_x - src_x),
SkIntToScalar(dest_y - src_y));
- ClipRectInt(src_x, src_y, w, h);
+ ClipRectInt(gfx::Rect(src_x, src_y, w, h));
canvas_->drawPaint(paint);
canvas_->restore();
}
« no previous file with comments | « ui/gfx/canvas_skia.h ('k') | ui/gfx/canvas_skia_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698