Lines Matching refs:index
58 int index = fArray.count(); in insert() local
61 this->percolateUpIfNecessary(index); in insert()
68 int index = *INDEX(entry); in remove() local
69 SkASSERT(index >= 0 && index < fArray.count()); in remove()
71 SkDEBUGCODE(*INDEX(fArray[index]) = -1;) in remove()
72 if (index == fArray.count() - 1) { in remove()
76 fArray[index] = fArray[fArray.count() - 1]; in remove()
78 this->setIndex(index); in remove()
79 this->percolateUpOrDown(index); in remove()
88 int index = *INDEX(entry); in priorityDidChange() local
89 SkASSERT(index >= 0 && index < fArray.count()); in priorityDidChange()
90 this->validate(index); in priorityDidChange()
91 this->percolateUpOrDown(index); in priorityDidChange()
103 void percolateUpOrDown(int index) { in percolateUpOrDown() argument
104 SkASSERT(index >= 0); in percolateUpOrDown()
105 if (!percolateUpIfNecessary(index)) { in percolateUpOrDown()
106 this->validate(index); in percolateUpOrDown()
107 this->percolateDownIfNecessary(index); in percolateUpOrDown()
111 bool percolateUpIfNecessary(int index) { in percolateUpIfNecessary() argument
112 SkASSERT(index >= 0); in percolateUpIfNecessary()
115 if (0 == index) { in percolateUpIfNecessary()
116 this->setIndex(index); in percolateUpIfNecessary()
119 int p = ParentOf(index); in percolateUpIfNecessary()
120 if (LESS(fArray[index], fArray[p])) { in percolateUpIfNecessary()
121 SkTSwap(fArray[index], fArray[p]); in percolateUpIfNecessary()
122 this->setIndex(index); in percolateUpIfNecessary()
123 index = p; in percolateUpIfNecessary()
126 this->setIndex(index); in percolateUpIfNecessary()
129 this->validate(index); in percolateUpIfNecessary()
133 void percolateDownIfNecessary(int index) { in percolateDownIfNecessary() argument
134 SkASSERT(index >= 0); in percolateDownIfNecessary()
136 int child = LeftOf(index); in percolateDownIfNecessary()
140 this->setIndex(index); in percolateDownIfNecessary()
146 if (LESS(fArray[child], fArray[index])) { in percolateDownIfNecessary()
147 SkTSwap(fArray[child], fArray[index]); in percolateDownIfNecessary()
149 this->setIndex(index); in percolateDownIfNecessary()
158 if (LESS(fArray[child], fArray[index])) { in percolateDownIfNecessary()
159 SkTSwap(fArray[child], fArray[index]); in percolateDownIfNecessary()
160 this->setIndex(index); in percolateDownIfNecessary()
161 index = child; in percolateDownIfNecessary()
164 this->setIndex(index); in percolateDownIfNecessary()
167 this->validate(index); in percolateDownIfNecessary()
171 void setIndex(int index) { in setIndex() argument
172 SkASSERT(index < fArray.count()); in setIndex()
174 *INDEX(fArray[index]) = index; in setIndex()