Chromium Code Reviews| Index: ui/gfx/canvas_direct2d.cc |
| diff --git a/ui/gfx/canvas_direct2d.cc b/ui/gfx/canvas_direct2d.cc |
| index 53cd6a1874842724b84871d0fa8b862e944b6151..b179df88ebc1895c1f3e823e97d3061a8e5bf188 100644 |
| --- a/ui/gfx/canvas_direct2d.cc |
| +++ b/ui/gfx/canvas_direct2d.cc |
| @@ -173,13 +173,14 @@ 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), |
| - D2D1_ANTIALIAS_MODE_PER_PRIMITIVE); |
| +bool CanvasDirect2D::ClipRectInt(const gfx::Rect& rect) { |
| + rt_->PushAxisAlignedClip( |
| + RectToRectF(rect.x(), rect.y(), rect.width(), rect.height()), |
|
Peter Kasting
2011/10/25 20:24:47
Nit: Just RectToRectF(rect) should work.
tfarina
2011/10/25 23:52:41
Done.
|
| + 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.width() > 0 && rect.height() > 0; |
|
Peter Kasting
2011/10/25 20:24:47
Nit: Simpler:
return !rect.IsEmpty();
tfarina
2011/10/25 23:52:41
Done.
|
| } |
| void CanvasDirect2D::TranslateInt(int x, int y) { |