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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 namespace { | 109 namespace { |
110 | 110 |
111 FloatRect PathBounds(const SkPath& path, Path::BoundsType bounds_type) { | 111 FloatRect PathBounds(const SkPath& path, Path::BoundsType bounds_type) { |
112 return bounds_type == Path::BoundsType::kConservative | 112 return bounds_type == Path::BoundsType::kConservative |
113 ? path.getBounds() | 113 ? path.getBounds() |
114 : path.computeTightBounds(); | 114 : path.computeTightBounds(); |
115 } | 115 } |
116 | 116 |
117 } // anonymous ns | 117 } // namespace |
118 | 118 |
119 // TODO(fmalita): evaluate returning exact bounds in all cases. | 119 // TODO(fmalita): evaluate returning exact bounds in all cases. |
120 FloatRect Path::BoundingRect(BoundsType bounds_type) const { | 120 FloatRect Path::BoundingRect(BoundsType bounds_type) const { |
121 return PathBounds(path_, bounds_type); | 121 return PathBounds(path_, bounds_type); |
122 } | 122 } |
123 | 123 |
124 FloatRect Path::StrokeBoundingRect(const StrokeData& stroke_data, | 124 FloatRect Path::StrokeBoundingRect(const StrokeData& stroke_data, |
125 BoundsType bounds_type) const { | 125 BoundsType bounds_type) const { |
126 return PathBounds(StrokePath(stroke_data), bounds_type); | 126 return PathBounds(StrokePath(stroke_data), bounds_type); |
127 } | 127 } |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 bool Path::IntersectPath(const Path& other) { | 546 bool Path::IntersectPath(const Path& other) { |
547 return Op(path_, other.path_, kIntersect_SkPathOp, &path_); | 547 return Op(path_, other.path_, kIntersect_SkPathOp, &path_); |
548 } | 548 } |
549 | 549 |
550 bool EllipseIsRenderable(float start_angle, float end_angle) { | 550 bool EllipseIsRenderable(float start_angle, float end_angle) { |
551 return (std::abs(end_angle - start_angle) < twoPiFloat) || | 551 return (std::abs(end_angle - start_angle) < twoPiFloat) || |
552 WebCoreFloatNearlyEqual(std::abs(end_angle - start_angle), twoPiFloat); | 552 WebCoreFloatNearlyEqual(std::abs(end_angle - start_angle), twoPiFloat); |
553 } | 553 } |
554 | 554 |
555 } // namespace blink | 555 } // namespace blink |
OLD | NEW |