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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11.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 | « ui/views/animation/test/ink_drop_animation_test_api.cc ('k') | ui/wm/core/image_grid.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/views/widget/desktop_aura/desktop_screen_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h"
6 6
7 #include <X11/extensions/Xrandr.h> 7 #include <X11/extensions/Xrandr.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 // It clashes with out RootWindow. 10 // It clashes with out RootWindow.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 if (has_work_area) { 319 if (has_work_area) {
320 gfx::Rect intersection_in_pixels = crtc_bounds; 320 gfx::Rect intersection_in_pixels = crtc_bounds;
321 intersection_in_pixels.Intersect(work_area_in_pixels); 321 intersection_in_pixels.Intersect(work_area_in_pixels);
322 // SetScaleAndBounds() above does the conversion from pixels to DIP for 322 // SetScaleAndBounds() above does the conversion from pixels to DIP for
323 // us, but set_work_area does not, so we need to do it here. 323 // us, but set_work_area does not, so we need to do it here.
324 display.set_work_area(gfx::Rect( 324 display.set_work_area(gfx::Rect(
325 gfx::ToFlooredPoint( 325 gfx::ToFlooredPoint(
326 gfx::ScalePoint(intersection_in_pixels.origin(), 326 gfx::ScalePoint(intersection_in_pixels.origin(),
327 1.0f / display.device_scale_factor())), 327 1.0f / display.device_scale_factor())),
328 gfx::ToFlooredSize( 328 gfx::ScaleToFlooredSize(intersection_in_pixels.size(),
329 gfx::ScaleSize(intersection_in_pixels.size(), 329 1.0f / display.device_scale_factor())));
330 1.0f / display.device_scale_factor()))));
331 } 330 }
332 331
333 switch (crtc->rotation) { 332 switch (crtc->rotation) {
334 case RR_Rotate_0: 333 case RR_Rotate_0:
335 display.set_rotation(gfx::Display::ROTATE_0); 334 display.set_rotation(gfx::Display::ROTATE_0);
336 break; 335 break;
337 case RR_Rotate_90: 336 case RR_Rotate_90:
338 display.set_rotation(gfx::Display::ROTATE_90); 337 display.set_rotation(gfx::Display::ROTATE_90);
339 break; 338 break;
340 case RR_Rotate_180: 339 case RR_Rotate_180:
(...skipping 21 matching lines...) Expand all
362 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); 361 change_notifier_.NotifyDisplaysChanged(old_displays, displays_);
363 } 362 }
364 363
365 //////////////////////////////////////////////////////////////////////////////// 364 ////////////////////////////////////////////////////////////////////////////////
366 365
367 gfx::Screen* CreateDesktopScreen() { 366 gfx::Screen* CreateDesktopScreen() {
368 return new DesktopScreenX11; 367 return new DesktopScreenX11;
369 } 368 }
370 369
371 } // namespace views 370 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/test/ink_drop_animation_test_api.cc ('k') | ui/wm/core/image_grid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698