1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/svg/SkSVGPaintState.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,89 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkSVGPaintState_DEFINED 1.14 +#define SkSVGPaintState_DEFINED 1.15 + 1.16 +#include "SkSVGBase.h" 1.17 +#include "SkString.h" 1.18 + 1.19 +class SkSVGPaint : public SkSVGBase { 1.20 +public: 1.21 + enum Field { 1.22 + kInitial = -1, 1.23 + kClipPath, 1.24 + kClipRule, 1.25 + kEnableBackground, 1.26 + kFill, 1.27 + kFillRule, 1.28 + kFilter, 1.29 + kFontFamily, 1.30 + kFontSize, 1.31 + kLetterSpacing, 1.32 + kMask, 1.33 + kOpacity, 1.34 + kStopColor, 1.35 + kStopOpacity, 1.36 + kStroke, 1.37 + kStroke_Dasharray, 1.38 + kStroke_Linecap, 1.39 + kStroke_Linejoin, 1.40 + kStroke_Miterlimit, 1.41 + kStroke_Width, 1.42 + kStyle, 1.43 + kTransform, 1.44 + kTerminal 1.45 + }; 1.46 + 1.47 + SkSVGPaint(); 1.48 + virtual void addAttribute(SkSVGParser& parser, int attrIndex, 1.49 + const char* attrValue, size_t attrLength); 1.50 + bool flush(SkSVGParser& , bool isFlushable, bool isDef); 1.51 + virtual int getAttributes(const SkSVGAttribute** attrPtr); 1.52 + static void Push(SkSVGPaint** head, SkSVGPaint* add); 1.53 + static void Pop(SkSVGPaint** head); 1.54 + SkString* operator[](int index); 1.55 + SkString fInitial; 1.56 + SkString f_clipPath; 1.57 + SkString f_clipRule; 1.58 + SkString f_enableBackground; 1.59 + SkString f_fill; 1.60 + SkString f_fillRule; 1.61 + SkString f_filter; 1.62 + SkString f_fontFamily; 1.63 + SkString f_fontSize; 1.64 + SkString f_letterSpacing; 1.65 + SkString f_mask; 1.66 + SkString f_opacity; 1.67 + SkString f_stopColor; 1.68 + SkString f_stopOpacity; 1.69 + SkString f_stroke; 1.70 + SkString f_strokeDasharray; 1.71 + SkString f_strokeLinecap; 1.72 + SkString f_strokeLinejoin; 1.73 + SkString f_strokeMiterlimit; 1.74 + SkString f_strokeWidth; 1.75 + SkString f_style; // unused, but allows array access to the rest 1.76 + SkString f_transform; 1.77 +#ifdef SK_DEBUG 1.78 + SkString fTerminal; 1.79 +#endif 1.80 + SkString fTransformID; 1.81 + static SkSVGAttribute gAttributes[]; 1.82 + static const int kAttributesSize; 1.83 +private: 1.84 + void setSave(SkSVGParser& ); 1.85 + bool writeChangedAttributes(SkSVGParser& , SkSVGPaint& , bool* changed); 1.86 + bool writeChangedElements(SkSVGParser& , SkSVGPaint& , bool* changed); 1.87 + SkSVGPaint* fNext; 1.88 + friend class SkSVGParser; 1.89 + typedef SkSVGPaint BASE_CLASS; 1.90 +}; 1.91 + 1.92 +#endif // SkSVGPaintState_DEFINED