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

Side by Side Diff: ui/aura/test/test_screen.cc

Issue 1302233006: aura: Stop converting Rect to RectF implicitly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rectfconvert-aura: . Created 5 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip_unittest.cc ('k') | ui/base/touch/selection_bound.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/aura/test/test_screen.h" 5 #include "ui/aura/test/test_screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 display_.set_rotation(rotation); 69 display_.set_rotation(rotation);
70 display_.SetScaleAndBounds(display_.device_scale_factor(), new_bounds); 70 display_.SetScaleAndBounds(display_.device_scale_factor(), new_bounds);
71 host_->SetRootTransform(GetRotationTransform() * GetUIScaleTransform()); 71 host_->SetRootTransform(GetRotationTransform() * GetUIScaleTransform());
72 } 72 }
73 73
74 void TestScreen::SetUIScale(float ui_scale) { 74 void TestScreen::SetUIScale(float ui_scale) {
75 ui_scale_ = ui_scale; 75 ui_scale_ = ui_scale;
76 gfx::Rect bounds_in_pixel(display_.GetSizeInPixel()); 76 gfx::Rect bounds_in_pixel(display_.GetSizeInPixel());
77 gfx::Rect new_bounds = gfx::ToNearestRect( 77 gfx::Rect new_bounds = gfx::ToNearestRect(
78 gfx::ScaleRect(bounds_in_pixel, 1.0f / ui_scale)); 78 gfx::ScaleRect(gfx::RectF(bounds_in_pixel), 1.0f / ui_scale));
79 display_.SetScaleAndBounds(display_.device_scale_factor(), new_bounds); 79 display_.SetScaleAndBounds(display_.device_scale_factor(), new_bounds);
80 host_->SetRootTransform(GetRotationTransform() * GetUIScaleTransform()); 80 host_->SetRootTransform(GetRotationTransform() * GetUIScaleTransform());
81 } 81 }
82 82
83 void TestScreen::SetWorkAreaInsets(const gfx::Insets& insets) { 83 void TestScreen::SetWorkAreaInsets(const gfx::Insets& insets) {
84 display_.UpdateWorkAreaFromInsets(insets); 84 display_.UpdateWorkAreaFromInsets(insets);
85 } 85 }
86 86
87 gfx::Transform TestScreen::GetRotationTransform() const { 87 gfx::Transform TestScreen::GetRotationTransform() const {
88 gfx::Transform rotate; 88 gfx::Transform rotate;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 TestScreen::TestScreen(const gfx::Rect& screen_bounds) 171 TestScreen::TestScreen(const gfx::Rect& screen_bounds)
172 : host_(NULL), 172 : host_(NULL),
173 ui_scale_(1.0f) { 173 ui_scale_(1.0f) {
174 static int64 synthesized_display_id = 2000; 174 static int64 synthesized_display_id = 2000;
175 display_.set_id(synthesized_display_id++); 175 display_.set_id(synthesized_display_id++);
176 display_.SetScaleAndBounds(1.0f, screen_bounds); 176 display_.SetScaleAndBounds(1.0f, screen_bounds);
177 } 177 }
178 178
179 } // namespace aura 179 } // namespace aura
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip_unittest.cc ('k') | ui/base/touch/selection_bound.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698