summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/constrained_window_views.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 00:11:05 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 00:11:05 +0000
commite728d1dbb22389af68d1adad7b18b985cde3bba1 (patch)
treeb760162eea5504ac6fe637e2cc6d9a0f62b07432 /chrome/browser/ui/views/constrained_window_views.cc
parent6b1ac06375f8f41be58938a5e94bcf5af0086ee2 (diff)
downloadchromium_src-e728d1dbb22389af68d1adad7b18b985cde3bba1.zip
chromium_src-e728d1dbb22389af68d1adad7b18b985cde3bba1.tar.gz
chromium_src-e728d1dbb22389af68d1adad7b18b985cde3bba1.tar.bz2
ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect.
BUG=100898 R=pkasting@chromium.org Review URL: http://codereview.chromium.org/8405002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/constrained_window_views.cc')
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc43
1 files changed, 24 insertions, 19 deletions
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index d48427c..b9f5af5 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -450,18 +450,28 @@ void ConstrainedWindowFrameView::PaintFrameBorder(gfx::Canvas* canvas) {
// Fill with the frame color first so we have a constant background for
// areas not covered by the theme image.
- canvas->FillRectInt(frame_color, 0, 0, width(), theme_frame->height());
- // Now fill down the sides.
- canvas->FillRectInt(frame_color, 0, theme_frame->height(), left_edge->width(),
- height() - theme_frame->height());
- canvas->FillRectInt(frame_color, width() - right_edge->width(),
- theme_frame->height(), right_edge->width(),
- height() - theme_frame->height());
- // Now fill the bottom area.
- canvas->FillRectInt(frame_color,
- left_edge->width(), height() - bottom_edge->height(),
- width() - left_edge->width() - right_edge->width(),
- bottom_edge->height());
+ canvas->FillRect(frame_color,
+ gfx::Rect(0, 0, width(), theme_frame->height()));
+
+ int remaining_height = height() - theme_frame->height();
+ if (remaining_height > 0) {
+ // Now fill down the sides.
+ canvas->FillRect(frame_color, gfx::Rect(0, theme_frame->height(),
+ left_edge->width(),
+ remaining_height));
+ canvas->FillRect(frame_color, gfx::Rect(width() - right_edge->width(),
+ theme_frame->height(),
+ right_edge->width(),
+ remaining_height));
+ int center_width = width() - left_edge->width() - right_edge->width();
+ if (center_width > 0) {
+ // Now fill the bottom area.
+ canvas->FillRect(frame_color,
+ gfx::Rect(left_edge->width(),
+ height() - bottom_edge->height(),
+ center_width, bottom_edge->height()));
+ }
+ }
// Draw the theme frame.
canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height());
@@ -508,13 +518,8 @@ void ConstrainedWindowFrameView::PaintClientEdge(gfx::Canvas* canvas) {
gfx::Rect frame_shadow_bounds(client_edge_bounds);
frame_shadow_bounds.Inset(-kFrameShadowThickness, -kFrameShadowThickness);
- canvas->FillRectInt(kContentsBorderShadow, frame_shadow_bounds.x(),
- frame_shadow_bounds.y(), frame_shadow_bounds.width(),
- frame_shadow_bounds.height());
-
- canvas->FillRectInt(ResourceBundle::toolbar_color, client_edge_bounds.x(),
- client_edge_bounds.y(), client_edge_bounds.width(),
- client_edge_bounds.height());
+ canvas->FillRect(kContentsBorderShadow, frame_shadow_bounds);
+ canvas->FillRect(ResourceBundle::toolbar_color, client_edge_bounds);
}
void ConstrainedWindowFrameView::LayoutWindowControls() {