OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
3 * 2006 Rob Buis <buis@kde.org> | 3 * 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 6 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return *this; | 61 return *this; |
62 } | 62 } |
63 | 63 |
64 bool Path::operator==(const Path& other) const | 64 bool Path::operator==(const Path& other) const |
65 { | 65 { |
66 return m_path == other.m_path; | 66 return m_path == other.m_path; |
67 } | 67 } |
68 | 68 |
69 bool Path::contains(const FloatPoint& point, WindRule rule) const | 69 bool Path::contains(const FloatPoint& point, WindRule rule) const |
70 { | 70 { |
71 return SkPathContainsPoint(m_path, point, rule == RULE_NONZERO ? SkPath::kWi
nding_FillType : SkPath::kEvenOdd_FillType); | 71 return SkPathContainsPoint(m_path, point, static_cast<SkPath::FillType>(rule
)); |
72 } | 72 } |
73 | 73 |
74 bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData)
const | 74 bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData)
const |
75 { | 75 { |
76 SkPaint paint; | 76 SkPaint paint; |
77 strokeData.setupPaint(&paint); | 77 strokeData.setupPaint(&paint); |
78 SkPath strokePath; | 78 SkPath strokePath; |
79 paint.getFillPath(m_path, &strokePath); | 79 paint.getFillPath(m_path, &strokePath); |
80 | 80 |
81 return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType); | 81 return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 WindRule Path::windRule() const | 271 WindRule Path::windRule() const |
272 { | 272 { |
273 return m_path.getFillType() == SkPath::kEvenOdd_FillType | 273 return m_path.getFillType() == SkPath::kEvenOdd_FillType |
274 ? RULE_EVENODD | 274 ? RULE_EVENODD |
275 : RULE_NONZERO; | 275 : RULE_NONZERO; |
276 } | 276 } |
277 | 277 |
278 void Path::setWindRule(const WindRule rule) | 278 void Path::setWindRule(const WindRule rule) |
279 { | 279 { |
280 m_path.setFillType(rule == RULE_EVENODD | 280 m_path.setFillType(static_cast<SkPath::FillType>(rule)); |
281 ? SkPath::kEvenOdd_FillType | |
282 : SkPath::kWinding_FillType); | |
283 } | 281 } |
284 | 282 |
285 void Path::moveTo(const FloatPoint& point) | 283 void Path::moveTo(const FloatPoint& point) |
286 { | 284 { |
287 m_path.moveTo(point.data()); | 285 m_path.moveTo(point.data()); |
288 } | 286 } |
289 | 287 |
290 void Path::addLineTo(const FloatPoint& point) | 288 void Path::addLineTo(const FloatPoint& point) |
291 { | 289 { |
292 m_path.lineTo(point.data()); | 290 m_path.lineTo(point.data()); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 497 |
500 #if ENABLE(ASSERT) | 498 #if ENABLE(ASSERT) |
501 bool ellipseIsRenderable(float startAngle, float endAngle) | 499 bool ellipseIsRenderable(float startAngle, float endAngle) |
502 { | 500 { |
503 return (std::abs(endAngle - startAngle) < twoPiFloat) | 501 return (std::abs(endAngle - startAngle) < twoPiFloat) |
504 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); | 502 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); |
505 } | 503 } |
506 #endif | 504 #endif |
507 | 505 |
508 } | 506 } |
OLD | NEW |