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

Unified Diff: views/window/custom_frame_view.cc

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: save some vertical space, interactive_ui_tests are fixed by Peter's fix 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 | « views/touchui/touch_selection_controller_impl.cc ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/window/custom_frame_view.cc
diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc
index 504a087558ea070ed2fffa00ba6fe1fb27a986c7..1b23eed7ed204d40a06f7229013b222b170f17bc 100644
--- a/views/window/custom_frame_view.cc
+++ b/views/window/custom_frame_view.cc
@@ -345,18 +345,28 @@ void CustomFrameView::PaintRestoredFrameBorder(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(), frame_image->height());
- // Now fill down the sides.
- canvas->FillRectInt(frame_color, 0, frame_image->height(), left_edge->width(),
- height() - frame_image->height());
- canvas->FillRectInt(frame_color, width() - right_edge->width(),
- frame_image->height(), right_edge->width(),
- height() - frame_image->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(), frame_image->height()));
+
+ int remaining_height = height() - frame_image->height();
+ if (remaining_height > 0) {
+ // Now fill down the sides.
+ canvas->FillRect(frame_color,
+ gfx::Rect(0, frame_image->height(), left_edge->width(),
+ remaining_height));
+ canvas->FillRect(frame_color,
+ gfx::Rect(width() - right_edge->width(),
+ frame_image->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(*frame_image, 0, 0, width(), frame_image->height());
« no previous file with comments | « views/touchui/touch_selection_controller_impl.cc ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698