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

Side by Side Diff: Source/platform/geometry/IntRect.h

Issue 208333020: [Mac] Rely on science, not chance, to get the proper definition of the macro (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « Source/platform/geometry/IntPoint.h ('k') | Source/platform/geometry/IntSize.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 /* 1 /*
2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #ifndef IntRect_h 26 #ifndef IntRect_h
27 #define IntRect_h 27 #define IntRect_h
28 28
29 #include "platform/geometry/IntPoint.h" 29 #include "platform/geometry/IntPoint.h"
30 #include "wtf/FastAllocBase.h" 30 #include "wtf/FastAllocBase.h"
31 #include "wtf/Vector.h" 31 #include "wtf/Vector.h"
32 32
33 #if OS(MACOSX) 33 #if OS(MACOSX)
34 typedef struct CGRect CGRect; 34 typedef struct CGRect CGRect;
35 35
36 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES 36 #ifdef __OBJC__
37 typedef struct CGRect NSRect; 37 #import <Foundation/Foundation.h>
38 #else
39 typedef struct _NSRect NSRect;
40 #endif 38 #endif
41 #endif 39 #endif
42 40
43 struct SkRect; 41 struct SkRect;
44 struct SkIRect; 42 struct SkIRect;
45 43
46 namespace WebCore { 44 namespace WebCore {
47 45
48 class FloatRect; 46 class FloatRect;
49 class LayoutRect; 47 class LayoutRect;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 void inflate(int d) { inflateX(d); inflateY(d); } 145 void inflate(int d) { inflateX(d); inflateY(d); }
148 void scale(float s); 146 void scale(float s);
149 147
150 IntSize differenceToPoint(const IntPoint&) const; 148 IntSize differenceToPoint(const IntPoint&) const;
151 int distanceSquaredToPoint(const IntPoint& p) const { return differenceToPoi nt(p).diagonalLengthSquared(); } 149 int distanceSquaredToPoint(const IntPoint& p) const { return differenceToPoi nt(p).diagonalLengthSquared(); }
152 150
153 IntRect transposedRect() const { return IntRect(m_location.transposedPoint() , m_size.transposedSize()); } 151 IntRect transposedRect() const { return IntRect(m_location.transposedPoint() , m_size.transposedSize()); }
154 152
155 #if OS(MACOSX) 153 #if OS(MACOSX)
156 operator CGRect() const; 154 operator CGRect() const;
157 #if !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 155 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
158 operator NSRect() const; 156 operator NSRect() const;
159 #endif 157 #endif
160 #endif 158 #endif
161 159
162 operator SkRect() const; 160 operator SkRect() const;
163 operator SkIRect() const; 161 operator SkIRect() const;
164 162
165 private: 163 private:
166 IntPoint m_location; 164 IntPoint m_location;
167 IntSize m_size; 165 IntSize m_size;
(...skipping 20 matching lines...) Expand all
188 return a.location() == b.location() && a.size() == b.size(); 186 return a.location() == b.location() && a.size() == b.size();
189 } 187 }
190 188
191 inline bool operator!=(const IntRect& a, const IntRect& b) 189 inline bool operator!=(const IntRect& a, const IntRect& b)
192 { 190 {
193 return a.location() != b.location() || a.size() != b.size(); 191 return a.location() != b.location() || a.size() != b.size();
194 } 192 }
195 193
196 #if OS(MACOSX) 194 #if OS(MACOSX)
197 PLATFORM_EXPORT IntRect enclosingIntRect(const CGRect&); 195 PLATFORM_EXPORT IntRect enclosingIntRect(const CGRect&);
198 #if !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) 196 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
199 PLATFORM_EXPORT IntRect enclosingIntRect(const NSRect&); 197 PLATFORM_EXPORT IntRect enclosingIntRect(const NSRect&);
200 #endif 198 #endif
201 #endif 199 #endif
202 200
203 } // namespace WebCore 201 } // namespace WebCore
204 202
205 #endif // IntRect_h 203 #endif // IntRect_h
OLDNEW
« no previous file with comments | « Source/platform/geometry/IntPoint.h ('k') | Source/platform/geometry/IntSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698