| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |