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

Side by Side Diff: ui/gfx/geometry/size.cc

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/gfx/geometry/size.h ('k') | ui/gfx/geometry/vector2d.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/geometry/size.h" 5 #include "ui/gfx/geometry/size.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_IOS) 9 #elif defined(OS_IOS)
10 #include <CoreGraphics/CoreGraphics.h> 10 #include <CoreGraphics/CoreGraphics.h>
11 #elif defined(OS_MACOSX) 11 #elif defined(OS_MACOSX)
12 #include <ApplicationServices/ApplicationServices.h> 12 #include <ApplicationServices/ApplicationServices.h>
13 #endif 13 #endif
14 14
15 #include "base/numerics/safe_math.h" 15 #include "base/numerics/safe_math.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "build/build_config.h"
17 #include "ui/gfx/geometry/size_conversions.h" 18 #include "ui/gfx/geometry/size_conversions.h"
18 19
19 namespace gfx { 20 namespace gfx {
20 21
21 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
22 Size::Size(const CGSize& s) 23 Size::Size(const CGSize& s)
23 : width_(s.width < 0 ? 0 : s.width), 24 : width_(s.width < 0 ? 0 : s.width),
24 height_(s.height < 0 ? 0 : s.height) { 25 height_(s.height < 0 ? 0 : s.height) {
25 } 26 }
26 27
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return ToRoundedSize(ScaleSize(gfx::SizeF(size), x_scale, y_scale)); 103 return ToRoundedSize(ScaleSize(gfx::SizeF(size), x_scale, y_scale));
103 } 104 }
104 105
105 Size ScaleToRoundedSize(const Size& size, float scale) { 106 Size ScaleToRoundedSize(const Size& size, float scale) {
106 if (scale == 1.f) 107 if (scale == 1.f)
107 return size; 108 return size;
108 return ToRoundedSize(ScaleSize(gfx::SizeF(size), scale, scale)); 109 return ToRoundedSize(ScaleSize(gfx::SizeF(size), scale, scale));
109 } 110 }
110 111
111 } // namespace gfx 112 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/geometry/size.h ('k') | ui/gfx/geometry/vector2d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698