Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPathByteStreamSource.h

Issue 1408143004: Use PathSegmentData+SVGPath{Consumer,Source} in PathSVGInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InterpolatedPathSource Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 namespace blink { 27 namespace blink {
28 28
29 class SVGPathByteStreamSource final : public SVGPathSource { 29 class SVGPathByteStreamSource final : public SVGPathSource {
30 public: 30 public:
31 explicit SVGPathByteStreamSource(const SVGPathByteStream& stream) 31 explicit SVGPathByteStreamSource(const SVGPathByteStream& stream)
32 : m_streamCurrent(stream.begin()) 32 : m_streamCurrent(stream.begin())
33 , m_streamEnd(stream.end()) 33 , m_streamEnd(stream.end())
34 { 34 {
35 } 35 }
36 36
37 private:
38 bool hasMoreData() const override; 37 bool hasMoreData() const override;
39 SVGPathSegType peekSegmentType() override; 38 SVGPathSegType peekSegmentType() override;
40 PathSegmentData parseSegment() override; 39 PathSegmentData parseSegment() override;
41 40
41 private:
42 #if COMPILER(MSVC) 42 #if COMPILER(MSVC)
43 #pragma warning(disable: 4701) 43 #pragma warning(disable: 4701)
44 #endif 44 #endif
45 template<typename DataType> 45 template<typename DataType>
46 DataType readType() 46 DataType readType()
47 { 47 {
48 ByteType<DataType> data; 48 ByteType<DataType> data;
49 size_t typeSize = sizeof(ByteType<DataType>); 49 size_t typeSize = sizeof(ByteType<DataType>);
50 ASSERT(m_streamCurrent + typeSize <= m_streamEnd); 50 ASSERT(m_streamCurrent + typeSize <= m_streamEnd);
51 memcpy(data.bytes, m_streamCurrent, typeSize); 51 memcpy(data.bytes, m_streamCurrent, typeSize);
(...skipping 11 matching lines...) Expand all
63 return FloatPoint(x, y); 63 return FloatPoint(x, y);
64 } 64 }
65 65
66 SVGPathByteStream::DataIterator m_streamCurrent; 66 SVGPathByteStream::DataIterator m_streamCurrent;
67 SVGPathByteStream::DataIterator m_streamEnd; 67 SVGPathByteStream::DataIterator m_streamEnd;
68 }; 68 };
69 69
70 } // namespace blink 70 } // namespace blink
71 71
72 #endif // SVGPathByteStreamSource_h 72 #endif // SVGPathByteStreamSource_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698