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

Unified Diff: include/xml/SkXMLWriter.h

Issue 899683002: [SkSVGDevice] Initial text support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: include/xml/SkXMLWriter.h
diff --git a/include/xml/SkXMLWriter.h b/include/xml/SkXMLWriter.h
index 214fefe86238bcd045d5b2ef4cc1bdda25a80699..593bc1ef3a601323a845f5bfc719e2818c56890d 100644
--- a/include/xml/SkXMLWriter.h
+++ b/include/xml/SkXMLWriter.h
@@ -27,6 +27,7 @@ public:
void addAttributeLen(const char name[], const char value[], size_t length);
void addHexAttribute(const char name[], uint32_t value, int minDigits = 0);
void addScalarAttribute(const char name[], SkScalar value);
+ void addText(const SkString& text);
void endElement() { this->onEndElement(); }
void startElement(const char elem[]);
void startElementLen(const char elem[], size_t length);
@@ -37,11 +38,18 @@ public:
protected:
virtual void onStartElementLen(const char elem[], size_t length) = 0;
virtual void onAddAttributeLen(const char name[], const char value[], size_t length) = 0;
+ virtual void onAddText(const SkString& text) = 0;
virtual void onEndElement() = 0;
struct Elem {
+ Elem(const char name[], size_t len)
+ : fName(name, len)
+ , fHasChildren(false)
+ , fHasText(false) {}
+
SkString fName;
bool fHasChildren;
+ bool fHasText;
};
void doEnd(Elem* elem);
bool doStart(const char name[], size_t length);
@@ -65,6 +73,8 @@ protected:
virtual void onStartElementLen(const char elem[], size_t length);
virtual void onEndElement();
virtual void onAddAttributeLen(const char name[], const char value[], size_t length);
+ virtual void onAddText(const SkString& text) SK_OVERRIDE;
+
private:
SkWStream& fStream;
};
@@ -77,6 +87,7 @@ protected:
virtual void onStartElementLen(const char elem[], size_t length);
virtual void onEndElement();
virtual void onAddAttributeLen(const char name[], const char value[], size_t length);
+ virtual void onAddText(const SkString& text) SK_OVERRIDE;
private:
SkXMLParser& fParser;
};

Powered by Google App Engine
This is Rietveld 408576698