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

Side by Side Diff: src/svg/parser/SkSVGEllipse.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 unified diff | Download patch
« no previous file with comments | « src/svg/parser/SkSVGEllipse.h ('k') | src/svg/parser/SkSVGFeColorMatrix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2006 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
9 #include "SkSVGEllipse.h"
10 #include "SkSVGParser.h"
11 #include "SkParse.h"
12 #include <stdio.h>
13
14 const SkSVGAttribute SkSVGEllipse::gAttributes[] = {
15 SVG_ATTRIBUTE(cx),
16 SVG_ATTRIBUTE(cy),
17 SVG_ATTRIBUTE(rx),
18 SVG_ATTRIBUTE(ry)
19 };
20
21 DEFINE_SVG_INFO(Ellipse)
22
23 void SkSVGEllipse::translate(SkSVGParser& parser, bool defState) {
24 parser._startElement("oval");
25 INHERITED::translate(parser, defState);
26 SkScalar cx, cy, rx, ry;
27 SkParse::FindScalar(f_cx.c_str(), &cx);
28 SkParse::FindScalar(f_cy.c_str(), &cy);
29 SkParse::FindScalar(f_rx.c_str(), &rx);
30 SkParse::FindScalar(f_ry.c_str(), &ry);
31 SkScalar left, top, right, bottom;
32 left = cx - rx;
33 top = cy - ry;
34 right = cx + rx;
35 bottom = cy + ry;
36 char scratch[16];
37 sprintf(scratch, "%g", SkScalarToDouble(left));
38 parser._addAttribute("left", scratch);
39 sprintf(scratch, "%g", SkScalarToDouble(top));
40 parser._addAttribute("top", scratch);
41 sprintf(scratch, "%g", SkScalarToDouble(right));
42 parser._addAttribute("right", scratch);
43 sprintf(scratch, "%g", SkScalarToDouble(bottom));
44 parser._addAttribute("bottom", scratch);
45 parser._endElement();
46 }
OLDNEW
« no previous file with comments | « src/svg/parser/SkSVGEllipse.h ('k') | src/svg/parser/SkSVGFeColorMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698