Lines Matching refs:graph
16 void GrTTopoSort_CheckAllUnmarked(const SkTArray<sk_sp<T>>& graph) {
17 for (int i = 0; i < graph.count(); ++i) {
18 SkASSERT(!Traits::IsTempMarked(graph[i].get()));
19 SkASSERT(!Traits::WasOutput(graph[i].get()));
24 void GrTTopoSort_CleanExit(const SkTArray<sk_sp<T>>& graph) {
25 for (int i = 0; i < graph.count(); ++i) {
26 SkASSERT(!Traits::IsTempMarked(graph[i].get()));
27 SkASSERT(Traits::WasOutput(graph[i].get()));
28 SkASSERT(Traits::GetIndex(graph[i].get()) == (uint32_t) i);
63 // Topologically sort the nodes in 'graph'. For this sort, when node 'i' depends
65 // A false return value means there was a loop and the contents of 'graph' will
85 bool GrTTopoSort(SkTArray<sk_sp<T>>* graph) {
89 GrTTopoSort_CheckAllUnmarked<T, Traits>(*graph);
94 for (int i = 0; i < graph->count(); ++i) {
95 if (Traits::WasOutput((*graph)[i].get())) {
102 if (!GrTTopoSort_Visit<T, Traits>((*graph)[i].get(), &counter)) {
107 SkASSERT(counter == (uint32_t) graph->count());
110 for (uint32_t i = 0; i < (uint32_t) graph->count(); ++i) {
111 for (uint32_t correctIndex = Traits::GetIndex((*graph)[i].get());
113 correctIndex = Traits::GetIndex((*graph)[i].get())) {
114 (*graph)[i].swap((*graph)[correctIndex]);
119 GrTTopoSort_CleanExit<T, Traits>(*graph);