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

Side by Side Diff: src/svg/SkSVGCircle.cpp

Issue 884713007: Move SVG parser files under {include,src}/svg/parser/ (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/SkSVGCircle.h ('k') | src/svg/SkSVGClipPath.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 /*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10 #include "SkSVGCircle.h"
11 #include "SkSVGParser.h"
12 #include "SkParse.h"
13 #include <stdio.h>
14
15 const SkSVGAttribute SkSVGCircle::gAttributes[] = {
16 SVG_ATTRIBUTE(cx),
17 SVG_ATTRIBUTE(cy),
18 SVG_ATTRIBUTE(r)
19 };
20
21 DEFINE_SVG_INFO(Circle)
22
23 void SkSVGCircle::translate(SkSVGParser& parser, bool defState) {
24 parser._startElement("oval");
25 INHERITED::translate(parser, defState);
26 SkScalar cx, cy, r;
27 SkParse::FindScalar(f_cx.c_str(), &cx);
28 SkParse::FindScalar(f_cy.c_str(), &cy);
29 SkParse::FindScalar(f_r.c_str(), &r);
30 SkScalar left, top, right, bottom;
31 left = cx - r;
32 top = cy - r;
33 right = cx + r;
34 bottom = cy + r;
35 char scratch[16];
36 sprintf(scratch, "%g", SkScalarToDouble(left));
37 parser._addAttribute("left", scratch);
38 sprintf(scratch, "%g", SkScalarToDouble(top));
39 parser._addAttribute("top", scratch);
40 sprintf(scratch, "%g", SkScalarToDouble(right));
41 parser._addAttribute("right", scratch);
42 sprintf(scratch, "%g", SkScalarToDouble(bottom));
43 parser._addAttribute("bottom", scratch);
44 parser._endElement();
45 }
OLDNEW
« no previous file with comments | « src/svg/SkSVGCircle.h ('k') | src/svg/SkSVGClipPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698