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

Unified Diff: src/svg/parser/SkSVGSVG.cpp

Issue 2154193003: Delete the legacy SVG parser (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « src/svg/parser/SkSVGSVG.h ('k') | src/svg/parser/SkSVGStop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/svg/parser/SkSVGSVG.cpp
diff --git a/src/svg/parser/SkSVGSVG.cpp b/src/svg/parser/SkSVGSVG.cpp
deleted file mode 100644
index 980636ba6a497cf4b5be43459739d3d1be4e7632..0000000000000000000000000000000000000000
--- a/src/svg/parser/SkSVGSVG.cpp
+++ /dev/null
@@ -1,72 +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.
- */
-
-
-#include "SkSVGSVG.h"
-#include "SkParse.h"
-#include "SkRect.h"
-#include "SkSVGParser.h"
-
-const SkSVGAttribute SkSVGSVG::gAttributes[] = {
- SVG_LITERAL_ATTRIBUTE(enable-background, f_enable_background),
- SVG_ATTRIBUTE(height),
- SVG_ATTRIBUTE(overflow),
- SVG_ATTRIBUTE(width),
- SVG_ATTRIBUTE(version),
- SVG_ATTRIBUTE(viewBox),
- SVG_ATTRIBUTE(x),
- SVG_LITERAL_ATTRIBUTE(xml:space, f_xml_space),
- SVG_ATTRIBUTE(xmlns),
- SVG_LITERAL_ATTRIBUTE(xmlns:xlink, f_xml_xlink),
- SVG_ATTRIBUTE(y),
-};
-
-DEFINE_SVG_INFO(SVG)
-
-
-bool SkSVGSVG::isFlushable() {
- return false;
-}
-
-void SkSVGSVG::translate(SkSVGParser& parser, bool defState) {
- SkScalar height, width;
- SkScalar viewBox[4];
- const char* hSuffix = SkParse::FindScalar(f_height.c_str(), &height);
- if (strcmp(hSuffix, "pt") == 0)
- height = SkScalarMulDiv(height, SK_Scalar1 * 72, SK_Scalar1 * 96);
- const char* wSuffix = SkParse::FindScalar(f_width.c_str(), &width);
- if (strcmp(wSuffix, "pt") == 0)
- width = SkScalarMulDiv(width, SK_Scalar1 * 72, SK_Scalar1 * 96);
- SkParse::FindScalars(f_viewBox.c_str(), viewBox, 4);
- SkRect box = SkRect::MakeLTRB(viewBox[0] / width, viewBox[1] / height,
- viewBox[2] / width, viewBox[3] / height);
- if (box.fLeft == 0 && box.fTop == 0 &&
- box.fRight == SK_Scalar1 && box.fBottom == SK_Scalar1)
- return;
- parser._startElement("matrix");
- if (box.fLeft != 0) {
- SkString x;
- x.appendScalar(box.fLeft);
- parser._addAttributeLen("translateX", x.c_str(), x.size());
- }
- if (box.fTop != 0) {
- SkString y;
- y.appendScalar(box.fTop);
- parser._addAttributeLen("translateY", y.c_str(), y.size());
- }
- if (box.fRight != SK_Scalar1) {
- SkString x;
- x.appendScalar(box.fRight);
- parser._addAttributeLen("scaleX", x.c_str(), x.size());
- }
- if (box.fBottom != SK_Scalar1) {
- SkString y;
- y.appendScalar(box.fBottom);
- parser._addAttributeLen("scaleY", y.c_str(), y.size());
- }
- parser._endElement();
-}
« no previous file with comments | « src/svg/parser/SkSVGSVG.h ('k') | src/svg/parser/SkSVGStop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698