OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 visitor->trace(m_radiusY); | 284 visitor->trace(m_radiusY); |
285 CSSBasicShape::trace(visitor); | 285 CSSBasicShape::trace(visitor); |
286 } | 286 } |
287 | 287 |
288 static String buildPolygonString(const WindRule& windRule, const Vector<String>& points, const String& layoutBox) | 288 static String buildPolygonString(const WindRule& windRule, const Vector<String>& points, const String& layoutBox) |
289 { | 289 { |
290 ASSERT(!(points.size() % 2)); | 290 ASSERT(!(points.size() % 2)); |
291 | 291 |
292 StringBuilder result; | 292 StringBuilder result; |
293 const char evenOddOpening[] = "polygon(evenodd, "; | 293 const char evenOddOpening[] = "polygon(evenodd, "; |
294 const char nonZeroOpening[] = "polygon(nonzero, "; | 294 const char nonZeroOpening[] = "polygon("; |
295 const char commaSeparator[] = ", "; | 295 const char commaSeparator[] = ", "; |
296 COMPILE_ASSERT(sizeof(evenOddOpening) == sizeof(nonZeroOpening), polygon_str ing_openings_have_same_length); | |
leviw_travelin_and_unemployed
2014/03/11 23:07:13
Would it make sense to assert that the evenOddOpen
| |
297 | 296 |
298 // Compute the required capacity in advance to reduce allocations. | 297 // Compute the required capacity in advance to reduce allocations. |
299 size_t length = sizeof(evenOddOpening) - 1; | 298 size_t length = sizeof(evenOddOpening) - 1; |
300 for (size_t i = 0; i < points.size(); i += 2) { | 299 for (size_t i = 0; i < points.size(); i += 2) { |
301 if (i) | 300 if (i) |
302 length += (sizeof(commaSeparator) - 1); | 301 length += (sizeof(commaSeparator) - 1); |
303 // add length of two strings, plus one for the space separator. | 302 // add length of two strings, plus one for the space separator. |
304 length += points[i].length() + 1 + points[i + 1].length(); | 303 length += points[i].length() + 1 + points[i + 1].length(); |
305 } | 304 } |
306 if (!layoutBox.isEmpty()) | 305 if (!layoutBox.isEmpty()) |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 visitor->trace(m_left); | 549 visitor->trace(m_left); |
551 visitor->trace(m_topLeftRadius); | 550 visitor->trace(m_topLeftRadius); |
552 visitor->trace(m_topRightRadius); | 551 visitor->trace(m_topRightRadius); |
553 visitor->trace(m_bottomRightRadius); | 552 visitor->trace(m_bottomRightRadius); |
554 visitor->trace(m_bottomLeftRadius); | 553 visitor->trace(m_bottomLeftRadius); |
555 CSSBasicShape::trace(visitor); | 554 CSSBasicShape::trace(visitor); |
556 } | 555 } |
557 | 556 |
558 } // namespace WebCore | 557 } // namespace WebCore |
559 | 558 |
OLD | NEW |