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

Unified Diff: include/xml/SkXMLWriter.h

Issue 899683002: [SkSVGDevice] Initial text support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: drop addText() length param 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
« no previous file with comments | « experimental/svg/SkSVGDevice.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/xml/SkXMLWriter.h
diff --git a/include/xml/SkXMLWriter.h b/include/xml/SkXMLWriter.h
index 214fefe86238bcd045d5b2ef4cc1bdda25a80699..b33ccd75d7065381672101fa5ce3ae1e62805588 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 char 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 char 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 char 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 char text[]) SK_OVERRIDE;
private:
SkXMLParser& fParser;
};
« no previous file with comments | « experimental/svg/SkSVGDevice.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698