Chromium Code Reviews| Index: ui/views/window/frame_background.cc |
| diff --git a/ui/views/window/frame_background.cc b/ui/views/window/frame_background.cc |
| index 553604f089c653059eb855c6eb717733c577eebe..cefff4ecf3f8f84c9842ea359c4f7f91aa1d55bb 100644 |
| --- a/ui/views/window/frame_background.cc |
| +++ b/ui/views/window/frame_background.cc |
| @@ -69,8 +69,8 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { |
| PaintFrameColor(canvas, view); |
| // Draw the theme frame. |
| - canvas->TileImageInt(*theme_bitmap_, |
| - 0, 0, view->width(), theme_bitmap_->height()); |
| + canvas->TileImage(*theme_bitmap_, |
| + gfx::Rect(0, 0, view->width(), theme_bitmap_->height())); |
| // Draw the theme frame overlay, if available. |
| if (theme_overlay_bitmap_) |
| @@ -85,11 +85,10 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { |
| 0, 0, top_left_corner_->width(), top_left_height, |
| 0, 0, top_left_corner_->width(), top_left_height, |
| false); |
| - canvas->TileImageInt(*top_edge_, |
| - top_left_corner_->width(), |
| + canvas->TileImage(*top_edge_, gfx::Rect(top_left_corner_->width(), |
| 0, |
| view->width() - top_left_corner_->width() - top_right_corner_->width(), |
|
tfarina
2012/02/08 19:45:15
Peter, this calculation is resulting in -2.
10 -
Peter Kasting
2012/02/08 20:54:57
Why is the view allowed to reach as small as 10 px
|
| - top_edge_->height()); |
| + top_edge_->height())); |
| int top_right_height = |
| std::min(top_right_corner_->height(), |
| view->height() - bottom_right_corner_->height()); |
| @@ -103,32 +102,30 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { |
| // Right edge. |
| int right_edge_height = |
| view->height() - top_right_height - bottom_right_corner_->height(); |
| - canvas->TileImageInt(*right_edge_, |
| - view->width() - right_edge_->width(), |
| - top_right_height, |
| - right_edge_->width(), |
| - right_edge_height); |
| + canvas->TileImage(*right_edge_, |
| + gfx::Rect(view->width() - right_edge_->width(), |
| + top_right_height, |
| + right_edge_->width(), |
| + right_edge_height)); |
| // Bottom corners and edge. |
| canvas->DrawBitmapInt(*bottom_right_corner_, |
| view->width() - bottom_right_corner_->width(), |
| view->height() - bottom_right_corner_->height()); |
| - canvas->TileImageInt( |
| - *bottom_edge_, |
| - bottom_left_corner_->width(), |
| - view->height() - bottom_edge_->height(), |
| - view->width() - bottom_left_corner_->width() |
| - - bottom_right_corner_->width(), |
| - bottom_edge_->height()); |
| + canvas->TileImage(*bottom_edge_, |
| + gfx::Rect(bottom_left_corner_->width(), |
| + view->height() - bottom_edge_->height(), |
| + view->width() - bottom_left_corner_->width() - |
| + bottom_right_corner_->width(), |
| + bottom_edge_->height())); |
| canvas->DrawBitmapInt(*bottom_left_corner_, 0, |
| view->height() - bottom_left_corner_->height()); |
| // Left edge. |
| int left_edge_height = |
| view->height() - top_left_height - bottom_left_corner_->height(); |
| - canvas->TileImageInt(*left_edge_, |
| - 0, top_left_height, |
| - left_edge_->width(), left_edge_height); |
| + canvas->TileImage(*left_edge_, gfx::Rect(0, top_left_height, |
| + left_edge_->width(), left_edge_height)); |
| } |
| void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { |
| @@ -159,11 +156,11 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { |
| } |
| // Draw the theme frame. |
| - canvas->TileImageInt(*theme_bitmap_, |
| - left_offset, |
| - maximized_top_offset_, |
| - view->width() - (left_offset + right_offset), |
| - theme_bitmap_->height()); |
| + canvas->TileImage(*theme_bitmap_, |
| + gfx::Rect(left_offset, |
| + maximized_top_offset_, |
| + view->width() - (left_offset + right_offset), |
| + theme_bitmap_->height())); |
| // Draw the theme frame overlay, if available. |
| if (theme_overlay_bitmap_) |
| canvas->DrawBitmapInt(*theme_overlay_bitmap_, 0, theme_background_y_); |