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

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

Issue 1460253002: SVGPath object "mutability" cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; byteStreamWillChange->byteStreamChanged; Drop some includes. Created 5 years 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 class SVGPathByteStream; 40 class SVGPathByteStream;
41 41
42 class SVGPath : public SVGPropertyBase { 42 class SVGPath : public SVGPropertyBase {
43 public: 43 public:
44 typedef void TearOffType; 44 typedef void TearOffType;
45 45
46 static PassRefPtrWillBeRawPtr<SVGPath> create() 46 static PassRefPtrWillBeRawPtr<SVGPath> create()
47 { 47 {
48 return adoptRefWillBeNoop(new SVGPath()); 48 return adoptRefWillBeNoop(new SVGPath());
49 } 49 }
50 static PassRefPtrWillBeRawPtr<SVGPath> create(PassOwnPtr<SVGPathByteStream> pathByteStream)
51 {
52 return adoptRefWillBeNoop(new SVGPath(pathByteStream));
53 }
50 54
51 ~SVGPath() override; 55 ~SVGPath() override;
52 56
53 const Path& path() const; 57 const Path& path() const;
54 58
55 const SVGPathByteStream& byteStream() const; 59 const SVGPathByteStream& byteStream() const;
56 SVGPathByteStream& mutableByteStream();
57 60
58 // SVGPropertyBase: 61 // SVGPropertyBase:
59 PassRefPtrWillBeRawPtr<SVGPath> clone() const; 62 PassRefPtrWillBeRawPtr<SVGPath> clone() const;
60 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con st override; 63 PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const String&) con st override;
61 String valueAsString() const override; 64 String valueAsString() const override;
62 void setValueAsString(const String&, ExceptionState&); 65 void setValueAsString(const String&, ExceptionState&);
63 66
64 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; 67 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override;
65 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn dOfDurationValue, SVGElement*) override; 68 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn dOfDurationValue, SVGElement*) override;
66 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt*) override; 69 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt*) override;
67 70
68 static AnimatedPropertyType classType() { return AnimatedPath; } 71 static AnimatedPropertyType classType() { return AnimatedPath; }
69 72
70 private: 73 private:
71 SVGPath(); 74 SVGPath();
72 explicit SVGPath(PassOwnPtr<SVGPathByteStream>); 75 explicit SVGPath(PassOwnPtr<SVGPathByteStream>);
73 76
74 SVGPathByteStream& ensureByteStream(); 77 SVGPathByteStream& ensureByteStream();
75 void byteStreamWillChange(); 78 void byteStreamChanged();
79 void setValueAsByteStream(PassOwnPtr<SVGPathByteStream>);
76 80
77 OwnPtr<SVGPathByteStream> m_byteStream; 81 OwnPtr<SVGPathByteStream> m_byteStream;
78 mutable OwnPtr<Path> m_cachedPath; 82 mutable OwnPtr<Path> m_cachedPath;
79 }; 83 };
80 84
81 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPath); 85 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGPath);
82 86
83 } // namespace blink 87 } // namespace blink
84 88
85 #endif 89 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/PathSVGInterpolation.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698