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 "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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 return rotate; | 103 return rotate; |
104 } | 104 } |
105 | 105 |
106 gfx::Transform TestScreen::GetUIScaleTransform() const { | 106 gfx::Transform TestScreen::GetUIScaleTransform() const { |
107 gfx::Transform ui_scale; | 107 gfx::Transform ui_scale; |
108 ui_scale.Scale(1.0f / ui_scale_, 1.0f / ui_scale_); | 108 ui_scale.Scale(1.0f / ui_scale_, 1.0f / ui_scale_); |
109 return ui_scale; | 109 return ui_scale; |
110 } | 110 } |
111 | 111 |
112 bool TestScreen::IsDIPEnabled() { | |
113 return true; | |
114 } | |
115 | |
116 void TestScreen::OnWindowBoundsChanged( | 112 void TestScreen::OnWindowBoundsChanged( |
117 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { | 113 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { |
118 DCHECK_EQ(host_->window(), window); | 114 DCHECK_EQ(host_->window(), window); |
119 display_.SetSize(gfx::ToFlooredSize( | 115 display_.SetSize(gfx::ToFlooredSize( |
120 gfx::ScaleSize(new_bounds.size(), display_.device_scale_factor()))); | 116 gfx::ScaleSize(new_bounds.size(), display_.device_scale_factor()))); |
121 } | 117 } |
122 | 118 |
123 void TestScreen::OnWindowDestroying(Window* window) { | 119 void TestScreen::OnWindowDestroying(Window* window) { |
124 if (host_->window() == window) | 120 if (host_->window() == window) |
125 host_ = NULL; | 121 host_ = NULL; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 166 |
171 TestScreen::TestScreen(const gfx::Rect& screen_bounds) | 167 TestScreen::TestScreen(const gfx::Rect& screen_bounds) |
172 : host_(NULL), | 168 : host_(NULL), |
173 ui_scale_(1.0f) { | 169 ui_scale_(1.0f) { |
174 static int64 synthesized_display_id = 2000; | 170 static int64 synthesized_display_id = 2000; |
175 display_.set_id(synthesized_display_id++); | 171 display_.set_id(synthesized_display_id++); |
176 display_.SetScaleAndBounds(1.0f, screen_bounds); | 172 display_.SetScaleAndBounds(1.0f, screen_bounds); |
177 } | 173 } |
178 | 174 |
179 } // namespace aura | 175 } // namespace aura |
OLD | NEW |