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

Side by Side Diff: ash/wm/frame_painter.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 overlay_bounds.Intersect( 130 overlay_bounds.Intersect(
131 gfx::Rect(bounds.origin(), frame_overlay_image->size())); 131 gfx::Rect(bounds.origin(), frame_overlay_image->size()));
132 int top_left_corner_radius = corner_radius; 132 int top_left_corner_radius = corner_radius;
133 int top_right_corner_radius = corner_radius; 133 int top_right_corner_radius = corner_radius;
134 if (overlay_bounds.width() < bounds.width() - corner_radius) 134 if (overlay_bounds.width() < bounds.width() - corner_radius)
135 top_right_corner_radius = 0; 135 top_right_corner_radius = 0;
136 TileRoundRect(canvas, *frame_overlay_image, paint, overlay_bounds, 136 TileRoundRect(canvas, *frame_overlay_image, paint, overlay_bounds,
137 top_left_corner_radius, top_right_corner_radius, 0); 137 top_left_corner_radius, top_right_corner_radius, 0);
138 } 138 }
139 } else { 139 } else {
140 gfx::Canvas temporary_canvas(bounds.size(), canvas->scale_factor(), false); 140 gfx::Canvas temporary_canvas(bounds.size(), canvas->scale(), false);
141 temporary_canvas.TileImageInt(*frame_image, 141 temporary_canvas.TileImageInt(*frame_image,
142 image_inset_x, 0, 142 image_inset_x, 0,
143 0, 0, 143 0, 0,
144 bounds.width(), bounds.height()); 144 bounds.width(), bounds.height());
145 temporary_canvas.DrawImageInt(*frame_overlay_image, 0, 0); 145 temporary_canvas.DrawImageInt(*frame_overlay_image, 0, 0);
146 TileRoundRect(canvas, gfx::ImageSkia(temporary_canvas.ExtractImageRep()), 146 TileRoundRect(canvas, gfx::ImageSkia(temporary_canvas.ExtractImageRep()),
147 paint, bounds, corner_radius, corner_radius, 0); 147 paint, bounds, corner_radius, corner_radius, 0);
148 } 148 }
149 } 149 }
150 150
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // icon. Don't use |window_icon_| for this computation as it may be NULL. 841 // icon. Don't use |window_icon_| for this computation as it may be NULL.
842 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; 842 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2;
843 return gfx::Rect( 843 return gfx::Rect(
844 title_x, 844 title_x,
845 std::max(0, title_y), 845 std::max(0, title_y),
846 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), 846 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x),
847 title_font.GetHeight()); 847 title_font.GetHeight());
848 } 848 }
849 849
850 } // namespace ash 850 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698