OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ellipse->setCenterX(convertToCenterCoordinate(state, ellipseValue.center
X())); | 213 ellipse->setCenterX(convertToCenterCoordinate(state, ellipseValue.center
X())); |
214 ellipse->setCenterY(convertToCenterCoordinate(state, ellipseValue.center
Y())); | 214 ellipse->setCenterY(convertToCenterCoordinate(state, ellipseValue.center
Y())); |
215 ellipse->setRadiusX(cssValueToBasicShapeRadius(state, ellipseValue.radiu
sX())); | 215 ellipse->setRadiusX(cssValueToBasicShapeRadius(state, ellipseValue.radiu
sX())); |
216 ellipse->setRadiusY(cssValueToBasicShapeRadius(state, ellipseValue.radiu
sY())); | 216 ellipse->setRadiusY(cssValueToBasicShapeRadius(state, ellipseValue.radiu
sY())); |
217 | 217 |
218 basicShape = ellipse.release(); | 218 basicShape = ellipse.release(); |
219 } else if (basicShapeValue.isBasicShapePolygonValue()) { | 219 } else if (basicShapeValue.isBasicShapePolygonValue()) { |
220 const CSSBasicShapePolygonValue& polygonValue = toCSSBasicShapePolygonVa
lue(basicShapeValue); | 220 const CSSBasicShapePolygonValue& polygonValue = toCSSBasicShapePolygonVa
lue(basicShapeValue); |
221 RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create(); | 221 RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create(); |
222 | 222 |
223 polygon->setWindRule(polygonValue.windRule()); | 223 polygon->setWindRule(polygonValue.getWindRule()); |
224 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>>& values =
polygonValue.values(); | 224 const WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>>& values =
polygonValue.values(); |
225 for (unsigned i = 0; i < values.size(); i += 2) | 225 for (unsigned i = 0; i < values.size(); i += 2) |
226 polygon->appendPoint(convertToLength(state, values.at(i).get()), con
vertToLength(state, values.at(i + 1).get())); | 226 polygon->appendPoint(convertToLength(state, values.at(i).get()), con
vertToLength(state, values.at(i + 1).get())); |
227 | 227 |
228 basicShape = polygon.release(); | 228 basicShape = polygon.release(); |
229 } else if (basicShapeValue.isBasicShapeInsetValue()) { | 229 } else if (basicShapeValue.isBasicShapeInsetValue()) { |
230 const CSSBasicShapeInsetValue& rectValue = toCSSBasicShapeInsetValue(bas
icShapeValue); | 230 const CSSBasicShapeInsetValue& rectValue = toCSSBasicShapeInsetValue(bas
icShapeValue); |
231 RefPtr<BasicShapeInset> rect = BasicShapeInset::create(); | 231 RefPtr<BasicShapeInset> rect = BasicShapeInset::create(); |
232 | 232 |
233 rect->setTop(convertToLength(state, rectValue.top())); | 233 rect->setTop(convertToLength(state, rectValue.top())); |
(...skipping 15 matching lines...) Expand all Loading... |
249 } | 249 } |
250 | 250 |
251 FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate& cente
rX, const BasicShapeCenterCoordinate& centerY, FloatSize boxSize) | 251 FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate& cente
rX, const BasicShapeCenterCoordinate& centerY, FloatSize boxSize) |
252 { | 252 { |
253 float x = floatValueForLength(centerX.computedLength(), boxSize.width()); | 253 float x = floatValueForLength(centerX.computedLength(), boxSize.width()); |
254 float y = floatValueForLength(centerY.computedLength(), boxSize.height()); | 254 float y = floatValueForLength(centerY.computedLength(), boxSize.height()); |
255 return FloatPoint(x, y); | 255 return FloatPoint(x, y); |
256 } | 256 } |
257 | 257 |
258 } // namespace blink | 258 } // namespace blink |
OLD | NEW |