| 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 "SkDisplayList.h" | 10 #include "SkDisplayList.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 validate(); | 45 validate(); |
| 46 result |= draw->draw(maker); | 46 result |= draw->draw(maker); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 validate(); | 49 validate(); |
| 50 return result; | 50 return result; |
| 51 } | 51 } |
| 52 | 52 |
| 53 int SkDisplayList::findGroup(SkADrawable* match, SkTDDrawableArray** list, | 53 int SkDisplayList::findGroup(SkADrawable* match, SkTDDrawableArray** list, |
| 54 SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) { | 54 SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) { |
| 55 *parent = NULL; | 55 *parent = nullptr; |
| 56 *list = &fDrawList; | 56 *list = &fDrawList; |
| 57 *grandList = &fDrawList; | 57 *grandList = &fDrawList; |
| 58 return SearchForMatch(match, list, parent, found, grandList); | 58 return SearchForMatch(match, list, parent, found, grandList); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void SkDisplayList::hardReset() { | 61 void SkDisplayList::hardReset() { |
| 62 fDrawList.reset(); | 62 fDrawList.reset(); |
| 63 fActiveList.reset(); | 63 fActiveList.reset(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool SkDisplayList::onIRect(const SkIRect& r) { | 66 bool SkDisplayList::onIRect(const SkIRect& r) { |
| 67 fBounds = r; | 67 fBounds = r; |
| 68 return fDrawBounds; | 68 return fDrawBounds; |
| 69 } | 69 } |
| 70 | 70 |
| 71 int SkDisplayList::SearchForMatch(SkADrawable* match, SkTDDrawableArray** list, | 71 int SkDisplayList::SearchForMatch(SkADrawable* match, SkTDDrawableArray** list, |
| 72 SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) { | 72 SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList) { |
| 73 *found = NULL; | 73 *found = nullptr; |
| 74 for (int index = 0; index < (*list)->count(); index++) { | 74 for (int index = 0; index < (*list)->count(); index++) { |
| 75 SkADrawable* draw = (**list)[index]; | 75 SkADrawable* draw = (**list)[index]; |
| 76 if (draw == match) | 76 if (draw == match) |
| 77 return index; | 77 return index; |
| 78 if (draw->isApply()) { | 78 if (draw->isApply()) { |
| 79 SkApply* apply = (SkApply*) draw; | 79 SkApply* apply = (SkApply*) draw; |
| 80 if (apply->scope == match) | 80 if (apply->scope == match) |
| 81 return index; | 81 return index; |
| 82 if (apply->scope->isGroup() && SearchGroupForMatch(apply->scope, mat
ch, list, parent, found, grandList, index)) | 82 if (apply->scope->isGroup() && SearchGroupForMatch(apply->scope, mat
ch, list, parent, found, grandList, index)) |
| 83 return index; | 83 return index; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 #endif | 149 #endif |
| 150 | 150 |
| 151 #ifdef SK_DEBUG | 151 #ifdef SK_DEBUG |
| 152 void SkDisplayList::validate() { | 152 void SkDisplayList::validate() { |
| 153 for (int index = 0; index < fDrawList.count(); index++) { | 153 for (int index = 0; index < fDrawList.count(); index++) { |
| 154 SkADrawable* draw = fDrawList[index]; | 154 SkADrawable* draw = fDrawList[index]; |
| 155 draw->validate(); | 155 draw->validate(); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 #endif | 158 #endif |
| OLD | NEW |