From 01c97230f890ca2650e490234a4c5e5190049fdc Mon Sep 17 00:00:00 2001 From: fmalita Date: Tue, 19 Jul 2016 06:12:54 -0700 Subject: Delete the legacy SVG parser Unused. R=reed@google.com,robertphillips@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2154193003 CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review-Url: https://codereview.chromium.org/2154193003 --- include/svg/parser/SkSVGAttribute.h | 43 ----------------- include/svg/parser/SkSVGBase.h | 25 ---------- include/svg/parser/SkSVGPaintState.h | 89 ------------------------------------ include/svg/parser/SkSVGParser.h | 73 ----------------------------- include/svg/parser/SkSVGTypes.h | 40 ---------------- 5 files changed, 270 deletions(-) delete mode 100644 include/svg/parser/SkSVGAttribute.h delete mode 100644 include/svg/parser/SkSVGBase.h delete mode 100644 include/svg/parser/SkSVGPaintState.h delete mode 100644 include/svg/parser/SkSVGParser.h delete mode 100644 include/svg/parser/SkSVGTypes.h (limited to 'include/svg') diff --git a/include/svg/parser/SkSVGAttribute.h b/include/svg/parser/SkSVGAttribute.h deleted file mode 100644 index 5ba2916b74..0000000000 --- a/include/svg/parser/SkSVGAttribute.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkSVGAttribute_DEFINED -#define SkSVGAttribute_DEFINED - -#include "SkTypes.h" - -struct SkSVGAttribute { - const char* fName; -#ifdef SK_DEBUG - size_t fOffset; -#endif -}; - -#ifndef SK_OFFSETOF - // This is offsetof for types which are not standard layout. - #define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1024)->field) - (char*)1024) -#endif - -#ifdef SK_DEBUG -#define SVG_ATTRIBUTE(attr) { #attr, SK_OFFSETOF(BASE_CLASS, f_##attr) } -#define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr, SK_OFFSETOF(BASE_CLASS, cAttr) } -#else -#define SVG_ATTRIBUTE(attr) { #attr } -#define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr } -#endif - -#define SVG_ADD_ATTRIBUTE(attr) \ - if (f_##attr.size() > 0) \ - parser._addAttributeLen(#attr, f_##attr.c_str(), f_##attr.size()) - -#define SVG_ADD_ATTRIBUTE_ALIAS(attr, alias) \ - if (f_##alias.size() > 0) \ - parser._addAttributeLen(#attr, f_##alias.c_str(), f_##alias.size()) - -#endif // SkSVGAttribute_DEFINED diff --git a/include/svg/parser/SkSVGBase.h b/include/svg/parser/SkSVGBase.h deleted file mode 100644 index 6bfc39d0bf..0000000000 --- a/include/svg/parser/SkSVGBase.h +++ /dev/null @@ -1,25 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkSVGBase_DEFINED -#define SkSVGBase_DEFINED - -#include "SkSVGAttribute.h" - -class SkSVGParser; - -class SkSVGBase { -public: - virtual ~SkSVGBase(); - virtual void addAttribute(SkSVGParser& parser, int attrIndex, - const char* attrValue, size_t attrLength); - virtual int getAttributes(const SkSVGAttribute** attrPtr) = 0; -}; - -#endif // SkSVGBase_DEFINEDes(const SkSVGAttribute** attrPtr) = 0; diff --git a/include/svg/parser/SkSVGPaintState.h b/include/svg/parser/SkSVGPaintState.h deleted file mode 100644 index 211e9cfce4..0000000000 --- a/include/svg/parser/SkSVGPaintState.h +++ /dev/null @@ -1,89 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkSVGPaintState_DEFINED -#define SkSVGPaintState_DEFINED - -#include "SkSVGBase.h" -#include "SkString.h" - -class SkSVGPaint : public SkSVGBase { -public: - enum Field { - kInitial = -1, - kClipPath, - kClipRule, - kEnableBackground, - kFill, - kFillRule, - kFilter, - kFontFamily, - kFontSize, - kLetterSpacing, - kMask, - kOpacity, - kStopColor, - kStopOpacity, - kStroke, - kStroke_Dasharray, - kStroke_Linecap, - kStroke_Linejoin, - kStroke_Miterlimit, - kStroke_Width, - kStyle, - kTransform, - kTerminal - }; - - SkSVGPaint(); - virtual void addAttribute(SkSVGParser& parser, int attrIndex, - const char* attrValue, size_t attrLength); - bool flush(SkSVGParser& , bool isFlushable, bool isDef); - virtual int getAttributes(const SkSVGAttribute** attrPtr); - static void Push(SkSVGPaint** head, SkSVGPaint* add); - static void Pop(SkSVGPaint** head); - SkString* operator[](int index); - SkString fInitial; - SkString f_clipPath; - SkString f_clipRule; - SkString f_enableBackground; - SkString f_fill; - SkString f_fillRule; - SkString f_filter; - SkString f_fontFamily; - SkString f_fontSize; - SkString f_letterSpacing; - SkString f_mask; - SkString f_opacity; - SkString f_stopColor; - SkString f_stopOpacity; - SkString f_stroke; - SkString f_strokeDasharray; - SkString f_strokeLinecap; - SkString f_strokeLinejoin; - SkString f_strokeMiterlimit; - SkString f_strokeWidth; - SkString f_style; // unused, but allows array access to the rest - SkString f_transform; -#ifdef SK_DEBUG - SkString fTerminal; -#endif - SkString fTransformID; - static SkSVGAttribute gAttributes[]; - static const int kAttributesSize; -private: - void setSave(SkSVGParser& ); - bool writeChangedAttributes(SkSVGParser& , SkSVGPaint& , bool* changed); - bool writeChangedElements(SkSVGParser& , SkSVGPaint& , bool* changed); - SkSVGPaint* fNext; - friend class SkSVGParser; - typedef SkSVGPaint BASE_CLASS; -}; - -#endif // SkSVGPaintState_DEFINED diff --git a/include/svg/parser/SkSVGParser.h b/include/svg/parser/SkSVGParser.h deleted file mode 100644 index 9a5c4157b1..0000000000 --- a/include/svg/parser/SkSVGParser.h +++ /dev/null @@ -1,73 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkSVGParser_DEFINED -#define SkSVGParser_DEFINED - -#include "SkMatrix.h" -#include "../private/SkTDict.h" -#include "SkSVGPaintState.h" -#include "SkSVGTypes.h" -#include "SkStream.h" -#include "SkString.h" -#include "SkXMLParser.h" -#include "SkXMLWriter.h" - -class SkSVGBase; -class SkSVGElement; - -class SkSVGParser : public SkXMLParser { -public: - SkSVGParser(SkXMLParserError* err = NULL); - virtual ~SkSVGParser(); - void _addAttribute(const char* attrName, const char* attrValue) { - fXMLWriter.addAttribute(attrName, attrValue); } - void _addAttribute(const char* attrName, SkString& attrValue) { - fXMLWriter.addAttribute(attrName, attrValue.c_str()); } - void _addAttributeLen(const char* attrName, const char* attrValue, size_t len) { - fXMLWriter.addAttributeLen(attrName, attrValue, len); } - void _endElement() { fXMLWriter.endElement(); } - int findAttribute(SkSVGBase* , const char* attrValue, size_t len, bool isPaint); -// const char* getFinal(); - SkTDict& getIDs() { return fIDs; } - SkString& getPaintLast(SkSVGPaint::Field field); - void _startElement(const char name[]) { fXMLWriter.startElement(name); } - void translate(SkSVGElement*, bool isDef); - void translateMatrix(SkString& , SkString* id); - static void ConvertToArray(SkString& vals); -protected: - virtual bool onAddAttribute(const char name[], const char value[]); - bool onAddAttributeLen(const char name[], const char value[], size_t len); - virtual bool onEndElement(const char elem[]); - virtual bool onStartElement(const char elem[]); - bool onStartElementLen(const char elem[], size_t len); - virtual bool onText(const char text[], int len); -private: - bool isStrokeAndFill(SkSVGPaint** stroke, SkSVGPaint** fill); - static SkSVGElement* CreateElement(SkSVGTypes type, SkSVGElement* parent); - static void Delete(SkTDArray& fChildren); - static SkSVGTypes GetType(const char name[], size_t len); - SkSVGPaint* fHead; - SkSVGPaint fEmptyPaint; - SkSVGPaint fLastFlush; - SkString fLastColor; - SkMatrix fLastTransform; - SkTDArray fChildren; - SkTDict fIDs; - SkTDArray fParents; - SkDynamicMemoryWStream fStream; - SkXMLStreamWriter fXMLWriter; - SkSVGElement* fCurrElement; - SkBool8 fInSVG; - SkBool8 fSuppressPaint; - friend class SkSVGPaint; - friend class SkSVGGradient; -}; - -#endif // SkSVGParser_DEFINED diff --git a/include/svg/parser/SkSVGTypes.h b/include/svg/parser/SkSVGTypes.h deleted file mode 100644 index b13bc6e4fc..0000000000 --- a/include/svg/parser/SkSVGTypes.h +++ /dev/null @@ -1,40 +0,0 @@ - -/* - * Copyright 2006 The Android Open Source Project - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -#ifndef SkSVGTypes_DEFINED -#define SkSVGTypes_DEFINED - -enum SkSVGTypes { - SkSVGType_Circle, - SkSVGType_ClipPath, - SkSVGType_Defs, - SkSVGType_Ellipse, - SkSVGType_FeColorMatrix, - SkSVGType_Filter, - SkSVGType_G, - SkSVGType_Image, - SkSVGType_Line, - SkSVGType_LinearGradient, - SkSVGType_Mask, - SkSVGType_Metadata, - SkSVGType_Path, - SkSVGType_Polygon, - SkSVGType_Polyline, - SkSVGType_RadialGradient, - SkSVGType_Rect, - SkSVGType_SVG, - SkSVGType_Stop, - SkSVGType_Symbol, - SkSVGType_Text, - SkSVGType_Tspan, - SkSVGType_Unknown, - SkSVGType_Use -}; - -#endif // SkSVGTypes_DEFINED -- cgit v1.2.3