Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / SVGPathByteStream.h
index 184dad4..1fedc1e 100644 (file)
 
 namespace WebCore {
 
-// Type definitions for the byte stream data
-typedef union {
-    bool value;
-    unsigned char bytes[sizeof(bool)];
-} BoolByte;
-
-typedef union {
-    float value;
-    unsigned char bytes[sizeof(float)];
-} FloatByte;
-
-typedef union {
-    unsigned short value;
-    unsigned char bytes[sizeof(unsigned short)];
-} UnsignedShortByte;
+template<typename DataType>
+union ByteType {
+    DataType value;
+    unsigned char bytes[sizeof(DataType)];
+};
 
 class SVGPathByteStream {
     WTF_MAKE_FAST_ALLOCATED;
@@ -61,13 +51,11 @@ public:
     DataIterator begin() { return m_data.begin(); }
     DataIterator end() { return m_data.end(); }
     void append(unsigned char byte) { m_data.append(byte); }
-    void append(SVGPathByteStream* other)
-    {
-        for (DataIterator it = other->begin(); it != other->end(); ++it)
-            append(*it);
-    }
+    void append(SVGPathByteStream* other) { m_data.append(other->m_data); }
     void clear() { m_data.clear(); }
-    bool isEmpty() const { return !m_data.size(); }
+    void reserveInitialCapacity(size_t size) { m_data.reserveInitialCapacity(size); }
+    void shrinkToFit() { m_data.shrinkToFit(); }
+    bool isEmpty() const { return m_data.isEmpty(); }
     unsigned size() const { return m_data.size(); }
 
     // Only defined to let SVGAnimatedPathAnimator use the standard list code paths - this method is never called.