 Chromium Code Reviews
 Chromium Code Reviews Issue 8383028:
  ui/gfx: Convert Canvas::ClipRectInt() to use gfx::Rect.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 8383028:
  ui/gfx: Convert Canvas::ClipRectInt() to use gfx::Rect.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "ui/views/view.h" | 5 #include "ui/views/view.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <functional> | 8 #include <functional> | 
| 9 | 9 | 
| 10 #include "ui/base/dragdrop/drag_drop_types.h" | 10 #include "ui/base/dragdrop/drag_drop_types.h" | 
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 545 } | 545 } | 
| 546 | 546 | 
| 547 // Painting -------------------------------------------------------------------- | 547 // Painting -------------------------------------------------------------------- | 
| 548 | 548 | 
| 549 void View::Paint(gfx::Canvas* canvas) { | 549 void View::Paint(gfx::Canvas* canvas) { | 
| 550 // Invisible views are not painted. | 550 // Invisible views are not painted. | 
| 551 if (!visible_) | 551 if (!visible_) | 
| 552 return; | 552 return; | 
| 553 | 553 | 
| 554 ScopedCanvasState canvas_state(canvas); | 554 ScopedCanvasState canvas_state(canvas); | 
| 555 if (canvas->ClipRectInt(x(), y(), width(), height())) { | 555 if (canvas->ClipRectInt(gfx::Rect(origin(), size()))) { | 
| 
Peter Kasting
2011/10/25 20:24:47
Nit: Isn't this just |bounds_|?
 
tfarina
2011/10/25 23:52:41
Done.
 | |
| 556 canvas->TranslateInt(x(), y()); | 556 canvas->TranslateInt(x(), y()); | 
| 557 // TODO(beng): RTL | 557 // TODO(beng): RTL | 
| 558 ScopedCanvasState canvas_state(canvas); | 558 ScopedCanvasState canvas_state(canvas); | 
| 559 OnPaint(canvas); | 559 OnPaint(canvas); | 
| 560 PaintChildren(canvas); | 560 PaintChildren(canvas); | 
| 561 } | 561 } | 
| 562 } | 562 } | 
| 563 | 563 | 
| 564 // Input ----------------------------------------------------------------------- | 564 // Input ----------------------------------------------------------------------- | 
| 565 | 565 | 
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 void View::WriteDragData(const gfx::Point& point, OSExchangeData* data) { | 655 void View::WriteDragData(const gfx::Point& point, OSExchangeData* data) { | 
| 656 drag_controller_->WriteDragData(this, point, data); | 656 drag_controller_->WriteDragData(this, point, data); | 
| 657 } | 657 } | 
| 658 | 658 | 
| 659 void View::StartShellDrag(const MouseEvent& event, | 659 void View::StartShellDrag(const MouseEvent& event, | 
| 660 const gfx::Point& press_point) { | 660 const gfx::Point& press_point) { | 
| 661 // TODO(beng): system stuff. | 661 // TODO(beng): system stuff. | 
| 662 } | 662 } | 
| 663 | 663 | 
| 664 } // namespace ui | 664 } // namespace ui | 
| OLD | NEW |