OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006,2007,2008, Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 inline bool WebCoreFloatNearlyEqual(float a, float b) | 90 inline bool WebCoreFloatNearlyEqual(float a, float b) |
91 { | 91 { |
92 return SkScalarNearlyEqual(WebCoreFloatToSkScalar(a), WebCoreFloatToSkScalar
(b)); | 92 return SkScalarNearlyEqual(WebCoreFloatToSkScalar(a), WebCoreFloatToSkScalar
(b)); |
93 } | 93 } |
94 | 94 |
95 inline SkPath::FillType WebCoreWindRuleToSkFillType(WindRule rule) | 95 inline SkPath::FillType WebCoreWindRuleToSkFillType(WindRule rule) |
96 { | 96 { |
97 return static_cast<SkPath::FillType>(rule); | 97 return static_cast<SkPath::FillType>(rule); |
98 } | 98 } |
99 | 99 |
| 100 inline WindRule SkFillTypeToWindRule(SkPath::FillType fillType) |
| 101 { |
| 102 switch (fillType) { |
| 103 case SkPath::kWinding_FillType: |
| 104 case SkPath::kEvenOdd_FillType: |
| 105 return static_cast<WindRule>(fillType); |
| 106 default: |
| 107 ASSERT_NOT_REACHED(); |
| 108 break; |
| 109 } |
| 110 return RULE_NONZERO; |
| 111 } |
| 112 |
100 // Determine if a given WebKit point is contained in a path | 113 // Determine if a given WebKit point is contained in a path |
101 bool SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType); | 114 bool SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType); |
102 | 115 |
103 SkMatrix affineTransformToSkMatrix(const AffineTransform&); | 116 SkMatrix PLATFORM_EXPORT affineTransformToSkMatrix(const AffineTransform&); |
104 | 117 |
105 bool nearlyIntegral(float value); | 118 bool nearlyIntegral(float value); |
106 | 119 |
107 InterpolationQuality limitInterpolationQuality(const GraphicsContext*, Interpola
tionQuality resampling); | 120 InterpolationQuality limitInterpolationQuality(const GraphicsContext*, Interpola
tionQuality resampling); |
108 | 121 |
109 InterpolationQuality computeInterpolationQuality( | 122 InterpolationQuality computeInterpolationQuality( |
110 const SkMatrix&, | 123 const SkMatrix&, |
111 float srcWidth, | 124 float srcWidth, |
112 float srcHeight, | 125 float srcHeight, |
113 float destWidth, | 126 float destWidth, |
114 float destHeight, | 127 float destHeight, |
115 bool isDataComplete = true); | 128 bool isDataComplete = true); |
116 | 129 |
117 bool shouldDrawAntiAliased(const GraphicsContext*, const SkRect& destRect); | 130 bool shouldDrawAntiAliased(const GraphicsContext*, const SkRect& destRect); |
118 | 131 |
119 } // namespace blink | 132 } // namespace blink |
120 | 133 |
121 #endif // SkiaUtils_h | 134 #endif // SkiaUtils_h |
OLD | NEW |