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 "SkDOM.h" | 10 #include "SkDOM.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 SkXMLParser* SkDOM::beginParsing() { | 367 SkXMLParser* SkDOM::beginParsing() { |
368 SkASSERT(!fParser); | 368 SkASSERT(!fParser); |
369 fParser.reset(new SkDOMParser(&fAlloc)); | 369 fParser.reset(new SkDOMParser(&fAlloc)); |
370 | 370 |
371 return fParser.get(); | 371 return fParser.get(); |
372 } | 372 } |
373 | 373 |
374 const SkDOM::Node* SkDOM::finishParsing() { | 374 const SkDOM::Node* SkDOM::finishParsing() { |
375 SkASSERT(fParser); | 375 SkASSERT(fParser); |
376 fRoot = fParser->getRoot(); | 376 fRoot = fParser->getRoot(); |
377 fParser.free(); | 377 fParser.reset(); |
378 | 378 |
379 return fRoot; | 379 return fRoot; |
380 } | 380 } |
381 | 381 |
382 ////////////////////////////////////////////////////////////////////////// | 382 ////////////////////////////////////////////////////////////////////////// |
383 | 383 |
384 int SkDOM::countChildren(const Node* node, const char elem[]) const | 384 int SkDOM::countChildren(const Node* node, const char elem[]) const |
385 { | 385 { |
386 int count = 0; | 386 int count = 0; |
387 | 387 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 SkASSERT(v == nullptr); | 506 SkASSERT(v == nullptr); |
507 | 507 |
508 SkASSERT(dom.getFirstChild(root, "elem1")); | 508 SkASSERT(dom.getFirstChild(root, "elem1")); |
509 SkASSERT(!dom.getFirstChild(root, "subelem1")); | 509 SkASSERT(!dom.getFirstChild(root, "subelem1")); |
510 | 510 |
511 dom.dump(); | 511 dom.dump(); |
512 #endif | 512 #endif |
513 } | 513 } |
514 | 514 |
515 #endif | 515 #endif |
OLD | NEW |