16#define CLUSTER_DEBUGF(...)
32 s.appendf(
"%s ", describe_task(t.get()).c_str());
40 s.appendf(
"%s ", describe_task(t).c_str());
53 "%s came before dependency %s",
54 describe_task(t).c_str(),
55 describe_task(dep).c_str());
59 for (
const auto& orig : input) {
74 CLUSTER_DEBUGF(
"Cluster: Bail, %s can't write before %s reads from %s.\n",
75 describe_task(depender).c_str(),
76 describe_task(dependee).c_str(),
77 depender->
target(
i)->getDebugName().c_str());
84 describe_task(depender).c_str(),
85 describe_task(dependee).c_str());
95 describe_task(task).c_str());
100 for (
int j = 0; j < task->
numTargets(); j++) {
117 CLUSTER_DEBUGF(
"Cluster: clusterTail is %s.\n", describe_task(clusterTail).c_str());
119 if (clusterTail == llist->
tail()) {
129 while (clusterHead->fPrev
132 clusterHead = clusterHead->fPrev;
137 for (
GrRenderTask* moved = movedHead; moved; moved = moved->fNext) {
138 for (
GrRenderTask* passed = clusterHead; passed != movedHead; passed = passed->fNext) {
148 describe_task(moved).c_str(),
149 describe_task(clusterHead).c_str());
163 if (input.size() < 3) {
164 for (
const auto& t : input) {
170 CLUSTER_DEBUGF(
"Cluster: Original order is %s\n", describe_tasks(input).c_str());
173 bool didReorder =
false;
174 for (
const auto& t : input) {
177 CLUSTER_DEBUGF(
"Cluster: Output order is now: %s\n", describe_tasks(*llist).c_str());
182 validate(input, *llist);
static bool depends_on(GrRenderTask *depender, GrRenderTask *dependee)
#define CLUSTER_DEBUGF(...)
static bool task_cluster_visit(GrRenderTask *task, SkTInternalLList< GrRenderTask > *llist, THashMap< GrSurfaceProxy *, GrRenderTask * > *lastTaskMap)
static GrSurfaceProxy * first_target(GrRenderTask *task)
bool GrClusterRenderTasks(SkSpan< const sk_sp< GrRenderTask > > input, SkTInternalLList< GrRenderTask > *llist)
#define SkASSERTF(cond, fmt,...)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
GrSurfaceProxy * target(int i) const
SkSpan< GrRenderTask * > dependencies()
bool isUsed(GrSurfaceProxy *proxy) const
bool dependsOn(const GrRenderTask *dependedOn) const
uint32_t uniqueID() const
void addBefore(T *newEntry, T *existingEntry)
V * find(const K &key) const
void remove(const K &key)
bool contains(const T &item) const
void remove(const T &item)