| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 PathSegmentData parseSegment(); | 38 PathSegmentData parseSegment(); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 #if COMPILER(MSVC) | 41 #if COMPILER(MSVC) |
| 42 #pragma warning(disable : 4701) | 42 #pragma warning(disable : 4701) |
| 43 #endif | 43 #endif |
| 44 template <typename DataType> | 44 template <typename DataType> |
| 45 DataType readType() { | 45 DataType readType() { |
| 46 ByteType<DataType> data; | 46 ByteType<DataType> data; |
| 47 size_t typeSize = sizeof(ByteType<DataType>); | 47 size_t typeSize = sizeof(ByteType<DataType>); |
| 48 ASSERT(m_streamCurrent + typeSize <= m_streamEnd); | 48 DCHECK_LE(m_streamCurrent + typeSize, m_streamEnd); |
| 49 memcpy(data.bytes, m_streamCurrent, typeSize); | 49 memcpy(data.bytes, m_streamCurrent, typeSize); |
| 50 m_streamCurrent += typeSize; | 50 m_streamCurrent += typeSize; |
| 51 return data.value; | 51 return data.value; |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool readFlag() { return readType<bool>(); } | 54 bool readFlag() { return readType<bool>(); } |
| 55 float readFloat() { return readType<float>(); } | 55 float readFloat() { return readType<float>(); } |
| 56 unsigned short readSVGSegmentType() { return readType<unsigned short>(); } | 56 unsigned short readSVGSegmentType() { return readType<unsigned short>(); } |
| 57 FloatPoint readFloatPoint() { | 57 FloatPoint readFloatPoint() { |
| 58 float x = readType<float>(); | 58 float x = readType<float>(); |
| 59 float y = readType<float>(); | 59 float y = readType<float>(); |
| 60 return FloatPoint(x, y); | 60 return FloatPoint(x, y); |
| 61 } | 61 } |
| 62 | 62 |
| 63 SVGPathByteStream::DataIterator m_streamCurrent; | 63 SVGPathByteStream::DataIterator m_streamCurrent; |
| 64 SVGPathByteStream::DataIterator m_streamEnd; | 64 SVGPathByteStream::DataIterator m_streamEnd; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| 68 | 68 |
| 69 #endif // SVGPathByteStreamSource_h | 69 #endif // SVGPathByteStreamSource_h |
| OLD | NEW |