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

Side by Side Diff: ui/gfx/geometry/rect_f.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 5 years 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/rect_f.h ('k') | ui/gfx/geometry/rect_unittest.cc » ('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/rect_f.h" 5 #include "ui/gfx/geometry/rect_f.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #if defined(OS_IOS) 9 #if 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/logging.h" 15 #include "base/logging.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "build/build_config.h"
17 #include "ui/gfx/geometry/insets_f.h" 18 #include "ui/gfx/geometry/insets_f.h"
18 #include "ui/gfx/geometry/safe_integer_conversions.h" 19 #include "ui/gfx/geometry/safe_integer_conversions.h"
19 20
20 namespace gfx { 21 namespace gfx {
21 22
22 static void AdjustAlongAxis(float dst_origin, 23 static void AdjustAlongAxis(float dst_origin,
23 float dst_size, 24 float dst_size,
24 float* origin, 25 float* origin,
25 float* size) { 26 float* size) {
26 *size = std::min(dst_size, *size); 27 *size = std::min(dst_size, *size);
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 254
254 RectF BoundingRect(const PointF& p1, const PointF& p2) { 255 RectF BoundingRect(const PointF& p1, const PointF& p2) {
255 float rx = std::min(p1.x(), p2.x()); 256 float rx = std::min(p1.x(), p2.x());
256 float ry = std::min(p1.y(), p2.y()); 257 float ry = std::min(p1.y(), p2.y());
257 float rr = std::max(p1.x(), p2.x()); 258 float rr = std::max(p1.x(), p2.x());
258 float rb = std::max(p1.y(), p2.y()); 259 float rb = std::max(p1.y(), p2.y());
259 return RectF(rx, ry, rr - rx, rb - ry); 260 return RectF(rx, ry, rr - rx, rb - ry);
260 } 261 }
261 262
262 } // namespace gfx 263 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/geometry/rect_f.h ('k') | ui/gfx/geometry/rect_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698