OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/frame_painter.h" | 5 #include "ash/wm/frame_painter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 overlay_bounds.Intersect( | 129 overlay_bounds.Intersect( |
130 gfx::Rect(bounds.origin(), frame_overlay_image->size())); | 130 gfx::Rect(bounds.origin(), frame_overlay_image->size())); |
131 int top_left_corner_radius = corner_radius; | 131 int top_left_corner_radius = corner_radius; |
132 int top_right_corner_radius = corner_radius; | 132 int top_right_corner_radius = corner_radius; |
133 if (overlay_bounds.width() < bounds.width() - corner_radius) | 133 if (overlay_bounds.width() < bounds.width() - corner_radius) |
134 top_right_corner_radius = 0; | 134 top_right_corner_radius = 0; |
135 TileRoundRect(canvas, *frame_overlay_image, paint, overlay_bounds, | 135 TileRoundRect(canvas, *frame_overlay_image, paint, overlay_bounds, |
136 top_left_corner_radius, top_right_corner_radius, 0); | 136 top_left_corner_radius, top_right_corner_radius, 0); |
137 } | 137 } |
138 } else { | 138 } else { |
139 gfx::Canvas temporary_canvas(bounds.size(), canvas->image_scale(), false); | 139 gfx::Canvas temporary_canvas(bounds.size(), canvas->scale_factor(), false); |
140 temporary_canvas.TileImageInt(*frame_image, | 140 temporary_canvas.TileImageInt(*frame_image, |
141 image_inset_x, 0, | 141 image_inset_x, 0, |
142 0, 0, | 142 0, 0, |
143 bounds.width(), bounds.height()); | 143 bounds.width(), bounds.height()); |
144 temporary_canvas.DrawImageInt(*frame_overlay_image, 0, 0); | 144 temporary_canvas.DrawImageInt(*frame_overlay_image, 0, 0); |
145 TileRoundRect(canvas, gfx::ImageSkia(temporary_canvas.ExtractImageRep()), | 145 TileRoundRect(canvas, gfx::ImageSkia(temporary_canvas.ExtractImageRep()), |
146 paint, bounds, corner_radius, corner_radius, 0); | 146 paint, bounds, corner_radius, corner_radius, 0); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 // icon. Don't use |window_icon_| for this computation as it may be NULL. | 840 // icon. Don't use |window_icon_| for this computation as it may be NULL. |
841 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; | 841 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; |
842 return gfx::Rect( | 842 return gfx::Rect( |
843 title_x, | 843 title_x, |
844 std::max(0, title_y), | 844 std::max(0, title_y), |
845 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), | 845 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), |
846 title_font.GetHeight()); | 846 title_font.GetHeight()); |
847 } | 847 } |
848 | 848 |
849 } // namespace ash | 849 } // namespace ash |
OLD | NEW |