gfx/skia/trunk/include/svg/SkSVGPaintState.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     2 /*
     3  * Copyright 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkSVGPaintState_DEFINED
    11 #define SkSVGPaintState_DEFINED
    13 #include "SkSVGBase.h"
    14 #include "SkString.h"
    16 class SkSVGPaint : public SkSVGBase {
    17 public:
    18     enum Field {
    19         kInitial = -1,
    20         kClipPath,
    21         kClipRule,
    22         kEnableBackground,
    23         kFill,
    24         kFillRule,
    25         kFilter,
    26         kFontFamily,
    27         kFontSize,
    28         kLetterSpacing,
    29         kMask,
    30         kOpacity,
    31         kStopColor,
    32         kStopOpacity,
    33         kStroke,
    34         kStroke_Dasharray,
    35         kStroke_Linecap,
    36         kStroke_Linejoin,
    37         kStroke_Miterlimit,
    38         kStroke_Width,
    39         kStyle,
    40         kTransform,
    41         kTerminal
    42     };
    44     SkSVGPaint();
    45     virtual void addAttribute(SkSVGParser& parser, int attrIndex,
    46         const char* attrValue, size_t attrLength);
    47     bool flush(SkSVGParser& , bool isFlushable, bool isDef);
    48     virtual int getAttributes(const SkSVGAttribute** attrPtr);
    49     static void Push(SkSVGPaint** head, SkSVGPaint* add);
    50     static void Pop(SkSVGPaint** head);
    51     SkString* operator[](int index);
    52     SkString fInitial;
    53     SkString f_clipPath;
    54     SkString f_clipRule;
    55     SkString f_enableBackground;
    56     SkString f_fill;
    57     SkString f_fillRule;
    58     SkString f_filter;
    59     SkString f_fontFamily;
    60     SkString f_fontSize;
    61     SkString f_letterSpacing;
    62     SkString f_mask;
    63     SkString f_opacity;
    64     SkString f_stopColor;
    65     SkString f_stopOpacity;
    66     SkString f_stroke;
    67     SkString f_strokeDasharray;
    68     SkString f_strokeLinecap;
    69     SkString f_strokeLinejoin;
    70     SkString f_strokeMiterlimit;
    71     SkString f_strokeWidth;
    72     SkString f_style; // unused, but allows array access to the rest
    73     SkString f_transform;
    74 #ifdef SK_DEBUG
    75     SkString fTerminal;
    76 #endif
    77     SkString fTransformID;
    78     static SkSVGAttribute gAttributes[];
    79     static const int kAttributesSize;
    80 private:
    81     void setSave(SkSVGParser& );
    82     bool writeChangedAttributes(SkSVGParser& , SkSVGPaint& , bool* changed);
    83     bool writeChangedElements(SkSVGParser& , SkSVGPaint& , bool* changed);
    84     SkSVGPaint* fNext;
    85     friend class SkSVGParser;
    86     typedef SkSVGPaint BASE_CLASS;
    87 };
    89 #endif // SkSVGPaintState_DEFINED

mercurial