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

Side by Side Diff: ui/compositor/dip_util.cc

Issue 10540091: Rename gfx::Monitor to gfx::Display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
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/compositor/dip_util.h" 5 #include "ui/compositor/dip_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "ui/base/ui_base_switches.h" 8 #include "ui/base/ui_base_switches.h"
9 #include "ui/compositor/compositor.h" 9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h" 10 #include "ui/compositor/compositor_switches.h"
11 #include "ui/compositor/layer.h" 11 #include "ui/compositor/layer.h"
12 #include "ui/gfx/monitor.h" 12 #include "ui/gfx/display.h"
13 #include "ui/gfx/point.h" 13 #include "ui/gfx/point.h"
14 #include "ui/gfx/rect.h"
14 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
15 #include "ui/gfx/rect.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 float GetDeviceScaleFactor(const Layer* layer) { 19 float GetDeviceScaleFactor(const Layer* layer) {
20 return layer->device_scale_factor(); 20 return layer->device_scale_factor();
21 } 21 }
22 22
23 gfx::Point ConvertPointToDIP(const Layer* layer, 23 gfx::Point ConvertPointToDIP(const Layer* layer,
24 const gfx::Point& point_in_pixel) { 24 const gfx::Point& point_in_pixel) {
25 return point_in_pixel.Scale(1.0f / GetDeviceScaleFactor(layer)); 25 return point_in_pixel.Scale(1.0f / GetDeviceScaleFactor(layer));
(...skipping 21 matching lines...) Expand all
47 return size_in_dip.Scale(GetDeviceScaleFactor(layer)); 47 return size_in_dip.Scale(GetDeviceScaleFactor(layer));
48 } 48 }
49 49
50 gfx::Rect ConvertRectToPixel(const Layer* layer, 50 gfx::Rect ConvertRectToPixel(const Layer* layer,
51 const gfx::Rect& rect_in_dip) { 51 const gfx::Rect& rect_in_dip) {
52 float scale = GetDeviceScaleFactor(layer); 52 float scale = GetDeviceScaleFactor(layer);
53 return gfx::Rect(rect_in_dip.origin().Scale(scale), 53 return gfx::Rect(rect_in_dip.origin().Scale(scale),
54 rect_in_dip.size().Scale(scale)); 54 rect_in_dip.size().Scale(scale));
55 } 55 }
56 } // namespace ui 56 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/events_x.cc ('k') | ui/compositor/layer.cc » ('j') | ui/gfx/screen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698