diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 18:28:20 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 18:28:20 +0000 |
commit | f286f77eec2281993efe4dd408448903334d55eb (patch) | |
tree | f6d1a521ae0842a8313880bbb1436fef2c3ee497 /views | |
parent | 0940ddebe40365351c6fc53bfaf39bd7cd176249 (diff) | |
download | chromium_src-f286f77eec2281993efe4dd408448903334d55eb.zip chromium_src-f286f77eec2281993efe4dd408448903334d55eb.tar.gz chromium_src-f286f77eec2281993efe4dd408448903334d55eb.tar.bz2 |
Implement initial ClipRect.
Move IntersectsClipRectInt and GetClipRect functions to CanvasSkia private, since they are only used internally.
BUG=none
TEST=see unittest.
Review URL: http://codereview.chromium.org/2959014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/border.cc | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/views/border.cc b/views/border.cc index 1259808..1dce649 100644 --- a/views/border.cc +++ b/views/border.cc @@ -34,30 +34,16 @@ SolidBorder::SolidBorder(int thickness, SkColor color) } void SolidBorder::Paint(const View& view, gfx::Canvas* canvas) const { - gfx::Rect clip_rect; - if (!canvas->GetClipRect(&clip_rect)) - return; // Empty clip rectangle, nothing to paint. - // Top border. - gfx::Rect border_bounds(0, 0, view.width(), insets_.top()); - if (clip_rect.Intersects(border_bounds)) - canvas->FillRectInt(color_, 0, 0, view.width(), insets_.top()); + canvas->FillRectInt(color_, 0, 0, view.width(), insets_.top()); // Left border. - border_bounds.SetRect(0, 0, insets_.left(), view.height()); - if (clip_rect.Intersects(border_bounds)) - canvas->FillRectInt(color_, 0, 0, insets_.left(), view.height()); + canvas->FillRectInt(color_, 0, 0, insets_.left(), view.height()); // Bottom border. - border_bounds.SetRect(0, view.height() - insets_.bottom(), - view.width(), insets_.bottom()); - if (clip_rect.Intersects(border_bounds)) - canvas->FillRectInt(color_, 0, view.height() - insets_.bottom(), - view.width(), insets_.bottom()); + canvas->FillRectInt(color_, 0, view.height() - insets_.bottom(), + view.width(), insets_.bottom()); // Right border. - border_bounds.SetRect(view.width() - insets_.right(), 0, - insets_.right(), view.height()); - if (clip_rect.Intersects(border_bounds)) - canvas->FillRectInt(color_, view.width() - insets_.right(), 0, - insets_.right(), view.height()); + canvas->FillRectInt(color_, view.width() - insets_.right(), 0, + insets_.right(), view.height()); } void SolidBorder::GetInsets(gfx::Insets* insets) const { |