OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkSVGElements.h" | 10 #include "SkSVGElements.h" |
11 #include "SkSVGParser.h" | 11 #include "SkSVGParser.h" |
12 | 12 |
13 SkSVGBase::~SkSVGBase() { | 13 SkSVGBase::~SkSVGBase() { |
14 } | 14 } |
15 | 15 |
16 void SkSVGBase::addAttribute(SkSVGParser& parser, int attrIndex, | 16 void SkSVGBase::addAttribute(SkSVGParser& parser, int attrIndex, |
17 const char* attrValue, size_t attrLength) { | 17 const char* attrValue, size_t attrLength) { |
18 SkString* first = (SkString*) ((char*) this + sizeof(SkSVGElement)); | 18 SkString* first = (SkString*) ((char*) this + sizeof(SkSVGElement)); |
19 first += attrIndex; | 19 first += attrIndex; |
20 first->set(attrValue, attrLength); | 20 first->set(attrValue, attrLength); |
21 } | 21 } |
22 | 22 |
23 | 23 |
24 SkSVGElement::SkSVGElement() : fParent(NULL), fIsDef(false), fIsNotDef(true) { | 24 SkSVGElement::SkSVGElement() : fParent(nullptr), fIsDef(false), fIsNotDef(true)
{ |
25 } | 25 } |
26 | 26 |
27 SkSVGElement::~SkSVGElement() { | 27 SkSVGElement::~SkSVGElement() { |
28 } | 28 } |
29 | 29 |
30 SkSVGElement* SkSVGElement::getGradient() { | 30 SkSVGElement* SkSVGElement::getGradient() { |
31 return NULL; | 31 return nullptr; |
32 } | 32 } |
33 | 33 |
34 bool SkSVGElement::isGroupParent() { | 34 bool SkSVGElement::isGroupParent() { |
35 SkSVGElement* parent = fParent; | 35 SkSVGElement* parent = fParent; |
36 while (parent) { | 36 while (parent) { |
37 if (parent->getType() != SkSVGType_G) | 37 if (parent->getType() != SkSVGType_G) |
38 return false; | 38 return false; |
39 parent = parent->fParent; | 39 parent = parent->fParent; |
40 } | 40 } |
41 return true; | 41 return true; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 fIsDef = isDef(); | 77 fIsDef = isDef(); |
78 } | 78 } |
79 | 79 |
80 //void SkSVGElement::setIsNotDef() { | 80 //void SkSVGElement::setIsNotDef() { |
81 // fIsNotDef = isNotDef(); | 81 // fIsNotDef = isNotDef(); |
82 //} | 82 //} |
83 | 83 |
84 void SkSVGElement::write(SkSVGParser& , SkString& ) { | 84 void SkSVGElement::write(SkSVGParser& , SkString& ) { |
85 SkASSERT(0); | 85 SkASSERT(0); |
86 } | 86 } |
OLD | NEW |