| 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 "SkDrawGroup.h" | 10 #include "SkDrawGroup.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 const SkMemberInfo SkGroup::fInfo[] = { | 22 const SkMemberInfo SkGroup::fInfo[] = { |
| 23 SK_MEMBER(condition, String), | 23 SK_MEMBER(condition, String), |
| 24 SK_MEMBER(enableCondition, String) | 24 SK_MEMBER(enableCondition, String) |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 DEFINE_GET_MEMBER(SkGroup); | 29 DEFINE_GET_MEMBER(SkGroup); |
| 30 | 30 |
| 31 SkGroup::SkGroup() : fParentList(NULL), fOriginal(NULL) { | 31 SkGroup::SkGroup() : fParentList(nullptr), fOriginal(nullptr) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 SkGroup::~SkGroup() { | 34 SkGroup::~SkGroup() { |
| 35 if (fOriginal) // has been copied | 35 if (fOriginal) // has been copied |
| 36 return; | 36 return; |
| 37 int index = 0; | 37 int index = 0; |
| 38 int max = fCopies.count() << 5; | 38 int max = fCopies.count() << 5; |
| 39 for (SkADrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { | 39 for (SkADrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { |
| 40 if (index >= max || markedForDelete(index)) | 40 if (index >= max || markedForDelete(index)) |
| 41 delete *ptr; | 41 delete *ptr; |
| 42 // else { | 42 // else { |
| 43 // SkApply* apply = (SkApply*) *ptr; | 43 // SkApply* apply = (SkApply*) *ptr; |
| 44 // SkASSERT(apply->isApply()); | 44 // SkASSERT(apply->isApply()); |
| 45 // SkASSERT(apply->getScope()); | 45 // SkASSERT(apply->getScope()); |
| 46 // delete apply->getScope(); | 46 // delete apply->getScope(); |
| 47 // } | 47 // } |
| 48 index++; | 48 index++; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool SkGroup::addChild(SkAnimateMaker& , SkDisplayable* child) { | 52 bool SkGroup::addChild(SkAnimateMaker& , SkDisplayable* child) { |
| 53 SkASSERT(child); | 53 SkASSERT(child); |
| 54 // SkASSERT(child->isDrawable()); | 54 // SkASSERT(child->isDrawable()); |
| 55 *fChildren.append() = (SkADrawable*) child; | 55 *fChildren.append() = (SkADrawable*) child; |
| 56 if (child->isGroup()) { | 56 if (child->isGroup()) { |
| 57 SkGroup* groupie = (SkGroup*) child; | 57 SkGroup* groupie = (SkGroup*) child; |
| 58 SkASSERT(groupie->fParentList == NULL); | 58 SkASSERT(groupie->fParentList == nullptr); |
| 59 groupie->fParentList = &fChildren; | 59 groupie->fParentList = &fChildren; |
| 60 } | 60 } |
| 61 return true; | 61 return true; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool SkGroup::contains(SkDisplayable* match) { | 64 bool SkGroup::contains(SkDisplayable* match) { |
| 65 for (SkADrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { | 65 for (SkADrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) { |
| 66 SkADrawable* drawable = *ptr; | 66 SkADrawable* drawable = *ptr; |
| 67 if (drawable == match || drawable->contains(match)) | 67 if (drawable == match || drawable->contains(match)) |
| 68 return true; | 68 return true; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 bool SkSave::draw(SkAnimateMaker& maker) { | 312 bool SkSave::draw(SkAnimateMaker& maker) { |
| 313 maker.fCanvas->save(); | 313 maker.fCanvas->save(); |
| 314 SkPaint* save = maker.fPaint; | 314 SkPaint* save = maker.fPaint; |
| 315 SkPaint local = SkPaint(*maker.fPaint); | 315 SkPaint local = SkPaint(*maker.fPaint); |
| 316 maker.fPaint = &local; | 316 maker.fPaint = &local; |
| 317 bool result = INHERITED::draw(maker); | 317 bool result = INHERITED::draw(maker); |
| 318 maker.fPaint = save; | 318 maker.fPaint = save; |
| 319 maker.fCanvas->restore(); | 319 maker.fCanvas->restore(); |
| 320 return result; | 320 return result; |
| 321 } | 321 } |
| OLD | NEW |