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

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

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 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 | « media/blink/skcanvas_video_renderer.cc ('k') | ui/base/cursor/cursor_util.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 gfx::Transform TestScreen::GetUIScaleTransform() const { 110 gfx::Transform TestScreen::GetUIScaleTransform() const {
111 gfx::Transform ui_scale; 111 gfx::Transform ui_scale;
112 ui_scale.Scale(1.0f / ui_scale_, 1.0f / ui_scale_); 112 ui_scale.Scale(1.0f / ui_scale_, 1.0f / ui_scale_);
113 return ui_scale; 113 return ui_scale;
114 } 114 }
115 115
116 void TestScreen::OnWindowBoundsChanged( 116 void TestScreen::OnWindowBoundsChanged(
117 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { 117 Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) {
118 DCHECK_EQ(host_->window(), window); 118 DCHECK_EQ(host_->window(), window);
119 display_.SetSize(gfx::ToFlooredSize( 119 display_.SetSize(gfx::ScaleToFlooredSize(new_bounds.size(),
120 gfx::ScaleSize(new_bounds.size(), display_.device_scale_factor()))); 120 display_.device_scale_factor()));
121 } 121 }
122 122
123 void TestScreen::OnWindowDestroying(Window* window) { 123 void TestScreen::OnWindowDestroying(Window* window) {
124 if (host_->window() == window) 124 if (host_->window() == window)
125 host_ = NULL; 125 host_ = NULL;
126 } 126 }
127 127
128 gfx::Point TestScreen::GetCursorScreenPoint() { 128 gfx::Point TestScreen::GetCursorScreenPoint() {
129 return Env::GetInstance()->last_mouse_location(); 129 return Env::GetInstance()->last_mouse_location();
130 } 130 }
(...skipping 39 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 | « media/blink/skcanvas_video_renderer.cc ('k') | ui/base/cursor/cursor_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698