Changeset 101300 in webkit
- Timestamp:
- Nov 28, 2011, 4:16:58 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 4 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/FloatQuad.cpp (modified) (2 diffs)
-
WebKit/chromium/ChangeLog (modified) (1 diff)
-
WebKit/chromium/WebKit.gypi (modified) (1 diff)
-
WebKit/chromium/tests/FloatQuadTest.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101296 r101300 1 2011-11-28 Dana Jansens <danakj@chromium.org> 2 3 FloatQuad::isRectilinear() returns false for 180degree rotations 4 https://bugs.webkit.org/show_bug.cgi?id=73040 5 6 Reviewed by James Robinson. 7 8 Added unit test FloatQuadTest.cpp. 9 10 * platform/graphics/FloatQuad.cpp: 11 (WebCore::withinEpsilon): Check two values are as close as can be represented by floats. 12 (WebCore::FloatQuad::isRectilinear): Use withinEpsilon(). 13 1 14 2011-11-28 Beth Dakin <bdakin@apple.com> 2 15 -
trunk/Source/WebCore/platform/graphics/FloatQuad.cpp
r95901 r101300 31 31 32 32 #include <algorithm> 33 #include <limits> 33 34 34 using std::max; 35 using std::min; 35 using namespace std; 36 36 37 37 namespace WebCore { … … 86 86 } 87 87 88 static inline bool withinEpsilon(float a, float b) 89 { 90 return fabs(a - b) < numeric_limits<float>::epsilon(); 91 } 92 88 93 bool FloatQuad::isRectilinear() const 89 94 { 90 return ( m_p1.x() == m_p2.x() && m_p2.y() == m_p3.y() && m_p3.x() == m_p4.x() && m_p4.y() == m_p1.y())91 || ( m_p1.y() == m_p2.y() && m_p2.x() == m_p3.x() && m_p3.y() == m_p4.y() && m_p4.x() == m_p1.x());95 return (withinEpsilon(m_p1.x(), m_p2.x()) && withinEpsilon(m_p2.y(), m_p3.y()) && withinEpsilon(m_p3.x(), m_p4.x()) && withinEpsilon(m_p4.y(), m_p1.y())) 96 || (withinEpsilon(m_p1.y(), m_p2.y()) && withinEpsilon(m_p2.x(), m_p3.x()) && withinEpsilon(m_p3.y(), m_p4.y()) && withinEpsilon(m_p4.x(), m_p1.x())); 92 97 } 93 98 -
trunk/Source/WebKit/chromium/ChangeLog
r101276 r101300 1 2011-11-28 Dana Jansens <danakj@chromium.org> 2 3 FloatQuad::isRectilinear() returns false for 180degree rotations 4 https://bugs.webkit.org/show_bug.cgi?id=73040 5 6 Reviewed by James Robinson. 7 8 * WebKit.gypi: 9 * tests/FloatQuadTest.cpp: Added. 10 (WebCore::TEST): 11 1 12 2011-11-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Source/WebKit/chromium/WebKit.gypi
r100958 r101300 67 67 'tests/CCSchedulerTestCommon.h', 68 68 'tests/CCThreadTaskTest.cpp', 69 'tests/FloatQuadTest.cpp', 69 70 'tests/FrameTestHelpers.cpp', 70 71 'tests/FrameTestHelpers.h',
Note:
See TracChangeset
for help on using the changeset viewer.