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

Unified Diff: ui/gfx/canvas_direct2d.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_direct2d.h ('k') | ui/gfx/canvas_direct2d_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_direct2d.cc
diff --git a/ui/gfx/canvas_direct2d.cc b/ui/gfx/canvas_direct2d.cc
index 53cd6a1874842724b84871d0fa8b862e944b6151..f824b4defaf82df4cf0d27c4ef44c1bb6269741b 100644
--- a/ui/gfx/canvas_direct2d.cc
+++ b/ui/gfx/canvas_direct2d.cc
@@ -173,13 +173,13 @@ void CanvasDirect2D::Restore() {
rt_->RestoreDrawingState(drawing_state_block_);
}
-bool CanvasDirect2D::ClipRectInt(int x, int y, int w, int h) {
- rt_->PushAxisAlignedClip(RectToRectF(x, y, w, h),
+bool CanvasDirect2D::ClipRectInt(const gfx::Rect& rect) {
+ rt_->PushAxisAlignedClip(RectToRectF(rect),
D2D1_ANTIALIAS_MODE_PER_PRIMITIVE);
// Increment the clip count so the call to PushAxisAlignedClip() can be
// balanced with a call to PopAxisAlignedClip in the next Restore().
++state_.top().clip_count;
- return w > 0 && h > 0;
+ return !rect.IsEmpty();
}
void CanvasDirect2D::TranslateInt(int x, int y) {
« no previous file with comments | « ui/gfx/canvas_direct2d.h ('k') | ui/gfx/canvas_direct2d_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698