| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #define FloatPoint_h | 28 #define FloatPoint_h |
| 29 | 29 |
| 30 #include "platform/geometry/FloatSize.h" | 30 #include "platform/geometry/FloatSize.h" |
| 31 #include "platform/geometry/IntPoint.h" | 31 #include "platform/geometry/IntPoint.h" |
| 32 #include "wtf/MathExtras.h" | 32 #include "wtf/MathExtras.h" |
| 33 #include <algorithm> | 33 #include <algorithm> |
| 34 | 34 |
| 35 #if OS(MACOSX) | 35 #if OS(MACOSX) |
| 36 typedef struct CGPoint CGPoint; | 36 typedef struct CGPoint CGPoint; |
| 37 | 37 |
| 38 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES | 38 #ifdef __OBJC__ |
| 39 typedef struct CGPoint NSPoint; | 39 #import <Foundation/Foundation.h> |
| 40 #else | |
| 41 typedef struct _NSPoint NSPoint; | |
| 42 #endif | 40 #endif |
| 43 #endif | 41 #endif |
| 44 | 42 |
| 45 struct SkPoint; | 43 struct SkPoint; |
| 46 | 44 |
| 47 namespace WebCore { | 45 namespace WebCore { |
| 48 | 46 |
| 49 class IntPoint; | 47 class IntPoint; |
| 50 class IntSize; | 48 class IntSize; |
| 51 class LayoutPoint; | 49 class LayoutPoint; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 124 } |
| 127 | 125 |
| 128 FloatPoint transposedPoint() const | 126 FloatPoint transposedPoint() const |
| 129 { | 127 { |
| 130 return FloatPoint(m_y, m_x); | 128 return FloatPoint(m_y, m_x); |
| 131 } | 129 } |
| 132 | 130 |
| 133 #if OS(MACOSX) | 131 #if OS(MACOSX) |
| 134 FloatPoint(const CGPoint&); | 132 FloatPoint(const CGPoint&); |
| 135 operator CGPoint() const; | 133 operator CGPoint() const; |
| 136 #if !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 134 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) |
| 137 FloatPoint(const NSPoint&); | 135 FloatPoint(const NSPoint&); |
| 138 operator NSPoint() const; | 136 operator NSPoint() const; |
| 139 #endif | 137 #endif |
| 140 #endif | 138 #endif |
| 141 | 139 |
| 142 operator SkPoint() const; | 140 operator SkPoint() const; |
| 143 | 141 |
| 144 private: | 142 private: |
| 145 float m_x, m_y; | 143 float m_x, m_y; |
| 146 }; | 144 }; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 229 } |
| 232 | 230 |
| 233 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); | 231 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); |
| 234 | 232 |
| 235 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. | 233 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. |
| 236 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); | 234 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); |
| 237 | 235 |
| 238 } | 236 } |
| 239 | 237 |
| 240 #endif | 238 #endif |
| OLD | NEW |