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/gfx/display.h" | 5 #include "ui/gfx/display.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 bounds_ = gfx::Rect( | 120 bounds_ = gfx::Rect( |
121 gfx::ToFlooredPoint(gfx::ScalePoint(bounds_in_pixel.origin(), | 121 gfx::ToFlooredPoint(gfx::ScalePoint(bounds_in_pixel.origin(), |
122 1.0f / device_scale_factor_)), | 122 1.0f / device_scale_factor_)), |
123 gfx::ToFlooredSize(gfx::ScaleSize(bounds_in_pixel.size(), | 123 gfx::ToFlooredSize(gfx::ScaleSize(bounds_in_pixel.size(), |
124 1.0f / device_scale_factor_))); | 124 1.0f / device_scale_factor_))); |
125 UpdateWorkAreaFromInsets(insets); | 125 UpdateWorkAreaFromInsets(insets); |
126 } | 126 } |
127 | 127 |
128 void Display::SetSize(const gfx::Size& size_in_pixel) { | 128 void Display::SetSize(const gfx::Size& size_in_pixel) { |
129 gfx::Point origin = bounds_.origin(); | 129 gfx::Point origin = bounds_.origin(); |
130 #if defined(USE_AURA) | 130 #if !defined(OS_LINUX) |
131 gfx::PointF origin_f = origin; | 131 gfx::PointF origin_f = origin; |
132 origin_f.Scale(device_scale_factor_); | 132 origin_f.Scale(device_scale_factor_); |
133 origin.SetPoint(origin_f.x(), origin_f.y()); | 133 origin.SetPoint(origin_f.x(), origin_f.y()); |
134 #endif | 134 #endif |
135 SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel)); | 135 SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel)); |
136 } | 136 } |
137 | 137 |
138 void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) { | 138 void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) { |
139 work_area_ = bounds_; | 139 work_area_ = bounds_; |
140 work_area_.Inset(insets); | 140 work_area_.Inset(insets); |
(...skipping 19 matching lines...) Expand all Loading... |
160 | 160 |
161 int64 Display::InternalDisplayId() { | 161 int64 Display::InternalDisplayId() { |
162 return internal_display_id_; | 162 return internal_display_id_; |
163 } | 163 } |
164 | 164 |
165 void Display::SetInternalDisplayId(int64 internal_display_id) { | 165 void Display::SetInternalDisplayId(int64 internal_display_id) { |
166 internal_display_id_ = internal_display_id; | 166 internal_display_id_ = internal_display_id; |
167 } | 167 } |
168 | 168 |
169 } // namespace gfx | 169 } // namespace gfx |
OLD | NEW |