| Index: experimental/svg/model/SkSVGNode.cpp
|
| diff --git a/experimental/svg/model/SkSVGNode.cpp b/experimental/svg/model/SkSVGNode.cpp
|
| index eb82834f38cb99ed2141a3812c9ada03f37f100b..34c6e17d619a34f9f97325ec8f01a3a5b89482e3 100644
|
| --- a/experimental/svg/model/SkSVGNode.cpp
|
| +++ b/experimental/svg/model/SkSVGNode.cpp
|
| @@ -16,18 +16,17 @@ SkSVGNode::SkSVGNode(SkSVGTag t) : fTag(t) { }
|
|
|
| SkSVGNode::~SkSVGNode() { }
|
|
|
| -void SkSVGNode::render(SkCanvas* canvas, const SkSVGRenderContext& ctx) const {
|
| - SkTCopyOnFirstWrite<SkSVGRenderContext> localContext(ctx);
|
| - fPresentationAttributes.applyTo(localContext);
|
| -
|
| - SkAutoCanvasRestore acr(canvas, false);
|
| - const SkMatrix& m = this->onLocalMatrix();
|
| - if (!m.isIdentity()) {
|
| - canvas->save();
|
| - canvas->concat(m);
|
| +void SkSVGNode::render(const SkSVGRenderContext& ctx) const {
|
| + SkSVGRenderContext localContext(ctx);
|
| +
|
| + if (this->onPrepareToRender(&localContext)) {
|
| + this->onRender(localContext);
|
| }
|
| +}
|
|
|
| - this->onRender(canvas, *localContext);
|
| +bool SkSVGNode::onPrepareToRender(SkSVGRenderContext* ctx) const {
|
| + fPresentationAttributes.applyTo(ctx);
|
| + return true;
|
| }
|
|
|
| void SkSVGNode::setAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
|
| @@ -51,7 +50,3 @@ void SkSVGNode::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
|
| break;
|
| }
|
| }
|
| -
|
| -const SkMatrix& SkSVGNode::onLocalMatrix() const {
|
| - return SkMatrix::I();
|
| -}
|
|
|