| 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 23 matching lines...) Expand all Loading... |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class FloatPolygonTestValue { | 36 class FloatPolygonTestValue { |
| 37 public: | 37 public: |
| 38 FloatPolygonTestValue(const float* coordinates, unsigned coordinatesLength,
WindRule fillRule) | 38 FloatPolygonTestValue(const float* coordinates, unsigned coordinatesLength,
WindRule fillRule) |
| 39 { | 39 { |
| 40 ASSERT(!(coordinatesLength % 2)); | 40 ASSERT(!(coordinatesLength % 2)); |
| 41 OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(co
ordinatesLength / 2)); | 41 OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(co
ordinatesLength / 2)); |
| 42 for (unsigned i = 0; i < coordinatesLength; i += 2) | 42 for (unsigned i = 0; i < coordinatesLength; i += 2) |
| 43 (*vertices)[i / 2] = FloatPoint(coordinates[i], coordinates[i + 1]); | 43 (*vertices)[i / 2] = FloatPoint(coordinates[i], coordinates[i + 1]); |
| 44 m_polygon = adoptPtr(new FloatPolygon(vertices.release(), fillRule)); | 44 m_polygon = adoptPtr(new FloatPolygon(std::move(vertices), fillRule)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 const FloatPolygon& polygon() const { return *m_polygon; } | 47 const FloatPolygon& polygon() const { return *m_polygon; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 OwnPtr<FloatPolygon> m_polygon; | 50 OwnPtr<FloatPolygon> m_polygon; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 namespace { | 53 namespace { |
| 54 | 54 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 EXPECT_FALSE(h.contains(FloatPoint(151, 100))); | 318 EXPECT_FALSE(h.contains(FloatPoint(151, 100))); |
| 319 EXPECT_FALSE(h.contains(FloatPoint(199, 100))); | 319 EXPECT_FALSE(h.contains(FloatPoint(199, 100))); |
| 320 EXPECT_FALSE(h.contains(FloatPoint(175, 125))); | 320 EXPECT_FALSE(h.contains(FloatPoint(175, 125))); |
| 321 EXPECT_FALSE(h.contains(FloatPoint(151, 250))); | 321 EXPECT_FALSE(h.contains(FloatPoint(151, 250))); |
| 322 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); | 322 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); |
| 323 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); | 323 EXPECT_FALSE(h.contains(FloatPoint(199, 250))); |
| 324 EXPECT_FALSE(h.contains(FloatPoint(175, 225))); | 324 EXPECT_FALSE(h.contains(FloatPoint(175, 225))); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace blink | 327 } // namespace blink |
| OLD | NEW |