1 /* 2 * Copyright 2016 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef SkSVGStop_DEFINED 9 #define SkSVGStop_DEFINED 10 11 #include "SkSVGHiddenContainer.h" 12 #include "SkSVGTypes.h" 13 14 class SkSVGLengthContext; 15 16 class SkSVGStop : public SkSVGHiddenContainer { 17 public: 18 ~SkSVGStop() override = default; Make()19 static sk_sp<SkSVGStop> Make() { 20 return sk_sp<SkSVGStop>(new SkSVGStop()); 21 } 22 offset()23 const SkSVGLength& offset() const { return fOffset; } stopColor()24 const SkSVGColorType& stopColor() const { return fStopColor; } stopOpacity()25 const SkSVGNumberType& stopOpacity() const { return fStopOpacity; } 26 27 void setOffset(const SkSVGLength&); 28 void setStopColor(const SkSVGColorType&); 29 void setStopOpacity(const SkSVGNumberType&); 30 31 protected: 32 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; 33 34 private: 35 SkSVGStop(); 36 37 SkSVGLength fOffset = SkSVGLength(0 , SkSVGLength::Unit::kPercentage); 38 SkSVGColorType fStopColor = SkSVGColorType(SK_ColorBLACK); 39 SkSVGNumberType fStopOpacity = SkSVGNumberType(1); 40 41 typedef SkSVGHiddenContainer INHERITED; 42 }; 43 44 #endif // SkSVGStop_DEFINED 45