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 19 matching lines...) Expand all Loading... |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/css/CSSBasicShapes.h" | 31 #include "core/css/CSSBasicShapes.h" |
32 | 32 |
33 #include "core/css/Pair.h" | 33 #include "core/css/Pair.h" |
34 #include "wtf/text/StringBuilder.h" | 34 #include "wtf/text/StringBuilder.h" |
35 | 35 |
36 using namespace WTF; | 36 using namespace WTF; |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 DEFINE_GC_INFO(CSSBasicShape); | |
41 | |
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) | 40 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 { | 41 { |
44 const char opening[] = "rectangle("; | 42 const char opening[] = "rectangle("; |
45 const char separator[] = ", "; | 43 const char separator[] = ", "; |
46 StringBuilder result; | 44 StringBuilder result; |
47 // Compute the required capacity in advance to reduce allocations. | 45 // 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)); | 46 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); | 47 result.appendLiteral(opening); |
50 result.append(x); | 48 result.append(x); |
51 result.appendLiteral(separator); | 49 result.appendLiteral(separator); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 visitor->trace(m_left); | 550 visitor->trace(m_left); |
553 visitor->trace(m_topLeftRadius); | 551 visitor->trace(m_topLeftRadius); |
554 visitor->trace(m_topRightRadius); | 552 visitor->trace(m_topRightRadius); |
555 visitor->trace(m_bottomRightRadius); | 553 visitor->trace(m_bottomRightRadius); |
556 visitor->trace(m_bottomLeftRadius); | 554 visitor->trace(m_bottomLeftRadius); |
557 CSSBasicShape::trace(visitor); | 555 CSSBasicShape::trace(visitor); |
558 } | 556 } |
559 | 557 |
560 } // namespace WebCore | 558 } // namespace WebCore |
561 | 559 |
OLD | NEW |