| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include <gtest/gtest.h> | 34 #include <gtest/gtest.h> |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class FloatPolygonTestValue { | 38 class FloatPolygonTestValue { |
| 39 public: | 39 public: |
| 40 FloatPolygonTestValue(const float* coordinates, unsigned coordinatesLength,
WindRule fillRule) | 40 FloatPolygonTestValue(const float* coordinates, unsigned coordinatesLength,
WindRule fillRule) |
| 41 { | 41 { |
| 42 ASSERT(!(coordinatesLength % 2)); | 42 ASSERT(!(coordinatesLength % 2)); |
| 43 OwnPtr<Vector<FloatPoint> > vertices = adoptPtr(new Vector<FloatPoint>(c
oordinatesLength / 2)); | 43 OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(co
ordinatesLength / 2)); |
| 44 for (unsigned i = 0; i < coordinatesLength; i += 2) | 44 for (unsigned i = 0; i < coordinatesLength; i += 2) |
| 45 (*vertices)[i / 2] = FloatPoint(coordinates[i], coordinates[i + 1]); | 45 (*vertices)[i / 2] = FloatPoint(coordinates[i], coordinates[i + 1]); |
| 46 m_polygon = adoptPtr(new FloatPolygon(vertices.release(), fillRule)); | 46 m_polygon = adoptPtr(new FloatPolygon(vertices.release(), fillRule)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 const FloatPolygon& polygon() const { return *m_polygon; } | 49 const FloatPolygon& polygon() const { return *m_polygon; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 OwnPtr<FloatPolygon> m_polygon; | 52 OwnPtr<FloatPolygon> m_polygon; |
| 53 }; | 53 }; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 EXPECT_FALSE(h.contains(FloatPoint(151, 100))); | 322 EXPECT_FALSE(h.contains(FloatPoint(151, 100))); |
| 323 EXPECT_FALSE(h.contains(FloatPoint(199, 100))); | 323 EXPECT_FALSE(h.contains(FloatPoint(199, 100))); |
| 324 EXPECT_FALSE(h.contains(FloatPoint(175, 125))); | 324 EXPECT_FALSE(h.contains(FloatPoint(175, 125))); |
| 325 EXPECT_FALSE(h.contains(FloatPoint(151, 250))); | 325 EXPECT_FALSE(h.contains(FloatPoint(151, 250))); |
| 326 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); | 326 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); |
| 327 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); | 327 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); |
| 328 EXPECT_FALSE(h.contains(FloatPoint(175, 225))); | 328 EXPECT_FALSE(h.contains(FloatPoint(175, 225))); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace | 331 } // namespace |
| OLD | NEW |