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

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

Issue 1023993002: Rework the SVGPathSource interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blender fixups. Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGPathBlender.cpp ('k') | Source/core/svg/SVGPathByteStreamSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
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: 37 private:
38 virtual bool hasMoreData() const override; 38 virtual bool hasMoreData() const override;
39 virtual bool moveToNextToken() override { return true; } 39 virtual SVGPathSegType peekSegmentType() override;
40 virtual bool parseSVGSegmentType(SVGPathSegType&) override; 40 virtual PathSegmentData parseSegment() override;
41 virtual SVGPathSegType nextCommand(SVGPathSegType) override;
42
43 virtual bool parseMoveToSegment(FloatPoint&) override;
44 virtual bool parseLineToSegment(FloatPoint&) override;
45 virtual bool parseLineToHorizontalSegment(float&) override;
46 virtual bool parseLineToVerticalSegment(float&) override;
47 virtual bool parseCurveToCubicSegment(FloatPoint&, FloatPoint&, FloatPoint&) override;
48 virtual bool parseCurveToCubicSmoothSegment(FloatPoint&, FloatPoint&) overri de;
49 virtual bool parseCurveToQuadraticSegment(FloatPoint&, FloatPoint&) override ;
50 virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&) override;
51 virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPo int&) override;
52 41
53 #if COMPILER(MSVC) 42 #if COMPILER(MSVC)
54 #pragma warning(disable: 4701) 43 #pragma warning(disable: 4701)
55 #endif 44 #endif
56 template<typename DataType> 45 template<typename DataType>
57 DataType readType() 46 DataType readType()
58 { 47 {
59 ByteType<DataType> data; 48 ByteType<DataType> data;
60 size_t typeSize = sizeof(ByteType<DataType>); 49 size_t typeSize = sizeof(ByteType<DataType>);
61 ASSERT(m_streamCurrent + typeSize <= m_streamEnd); 50 ASSERT(m_streamCurrent + typeSize <= m_streamEnd);
(...skipping 12 matching lines...) Expand all
74 return FloatPoint(x, y); 63 return FloatPoint(x, y);
75 } 64 }
76 65
77 SVGPathByteStream::DataIterator m_streamCurrent; 66 SVGPathByteStream::DataIterator m_streamCurrent;
78 SVGPathByteStream::DataIterator m_streamEnd; 67 SVGPathByteStream::DataIterator m_streamEnd;
79 }; 68 };
80 69
81 } // namespace blink 70 } // namespace blink
82 71
83 #endif // SVGPathByteStreamSource_h 72 #endif // SVGPathByteStreamSource_h
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathBlender.cpp ('k') | Source/core/svg/SVGPathByteStreamSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698