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

Side by Side Diff: ui/gfx/display.cc

Issue 649203003: Type conversion fixes, ui/gfx/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 years, 1 month 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/gfx/color_utils.cc ('k') | ui/gfx/geometry/insets.h » ('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/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 gfx::ToFlooredSize(gfx::ScaleSize(bounds_in_pixel.size(), 146 gfx::ToFlooredSize(gfx::ScaleSize(bounds_in_pixel.size(),
147 1.0f / device_scale_factor_))); 147 1.0f / device_scale_factor_)));
148 UpdateWorkAreaFromInsets(insets); 148 UpdateWorkAreaFromInsets(insets);
149 } 149 }
150 150
151 void Display::SetSize(const gfx::Size& size_in_pixel) { 151 void Display::SetSize(const gfx::Size& size_in_pixel) {
152 gfx::Point origin = bounds_.origin(); 152 gfx::Point origin = bounds_.origin();
153 #if defined(USE_AURA) 153 #if defined(USE_AURA)
154 gfx::PointF origin_f = origin; 154 gfx::PointF origin_f = origin;
155 origin_f.Scale(device_scale_factor_); 155 origin_f.Scale(device_scale_factor_);
156 origin.SetPoint(origin_f.x(), origin_f.y()); 156 origin = gfx::ToFlooredPoint(origin_f);
157 #endif 157 #endif
158 SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel)); 158 SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel));
159 } 159 }
160 160
161 void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) { 161 void Display::UpdateWorkAreaFromInsets(const gfx::Insets& insets) {
162 work_area_ = bounds_; 162 work_area_ = bounds_;
163 work_area_.Inset(insets); 163 work_area_.Inset(insets);
164 } 164 }
165 165
166 gfx::Size Display::GetSizeInPixel() const { 166 gfx::Size Display::GetSizeInPixel() const {
(...skipping 16 matching lines...) Expand all
183 183
184 int64 Display::InternalDisplayId() { 184 int64 Display::InternalDisplayId() {
185 return internal_display_id_; 185 return internal_display_id_;
186 } 186 }
187 187
188 void Display::SetInternalDisplayId(int64 internal_display_id) { 188 void Display::SetInternalDisplayId(int64 internal_display_id) {
189 internal_display_id_ = internal_display_id; 189 internal_display_id_ = internal_display_id;
190 } 190 }
191 191
192 } // namespace gfx 192 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/color_utils.cc ('k') | ui/gfx/geometry/insets.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698