| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "core/css/CSSValuePool.h" | 33 #include "core/css/CSSValuePool.h" |
| 34 #include "core/css/Pair.h" | 34 #include "core/css/Pair.h" |
| 35 #include "platform/Length.h" | 35 #include "platform/Length.h" |
| 36 #include "wtf/text/StringBuilder.h" | 36 #include "wtf/text/StringBuilder.h" |
| 37 | 37 |
| 38 using namespace WTF; | 38 using namespace WTF; |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 DEFINE_EMPTY_DESTRUCTOR_WILL_BY_NONE(CSSBasicShape) |
| 43 |
| 42 static String buildRectangleString(const String& x, const String& y, const Strin
g& width, const String& height, const String& radiusX, const String& radiusY, co
nst String& layoutBox) | 44 static String buildRectangleString(const String& x, const String& y, const Strin
g& width, const String& height, const String& radiusX, const String& radiusY, co
nst String& layoutBox) |
| 43 { | 45 { |
| 44 const char opening[] = "rectangle("; | 46 const char opening[] = "rectangle("; |
| 45 const char separator[] = ", "; | 47 const char separator[] = ", "; |
| 46 StringBuilder result; | 48 StringBuilder result; |
| 47 // Compute the required capacity in advance to reduce allocations. | 49 // Compute the required capacity in advance to reduce allocations. |
| 48 result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1))
+ 1 + x.length() + y.length() + width.length() + height.length() + radiusX.leng
th() + radiusY.length() + (layoutBox.isEmpty() ? 0 : layoutBox.length() + 1)); | 50 result.reserveCapacity((sizeof(opening) - 1) + (5 * (sizeof(separator) - 1))
+ 1 + x.length() + y.length() + width.length() + height.length() + radiusX.leng
th() + radiusY.length() + (layoutBox.isEmpty() ? 0 : layoutBox.length() + 1)); |
| 49 result.appendLiteral(opening); | 51 result.appendLiteral(opening); |
| 50 result.append(x); | 52 result.append(x); |
| 51 result.appendLiteral(separator); | 53 result.appendLiteral(separator); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 visitor->trace(m_left); | 602 visitor->trace(m_left); |
| 601 visitor->trace(m_topLeftRadius); | 603 visitor->trace(m_topLeftRadius); |
| 602 visitor->trace(m_topRightRadius); | 604 visitor->trace(m_topRightRadius); |
| 603 visitor->trace(m_bottomRightRadius); | 605 visitor->trace(m_bottomRightRadius); |
| 604 visitor->trace(m_bottomLeftRadius); | 606 visitor->trace(m_bottomLeftRadius); |
| 605 CSSBasicShape::trace(visitor); | 607 CSSBasicShape::trace(visitor); |
| 606 } | 608 } |
| 607 | 609 |
| 608 } // namespace WebCore | 610 } // namespace WebCore |
| 609 | 611 |
| OLD | NEW |