Optimize GrOpsTask::onIsUsed

Before this CL, the render task clustering algorithm was taking
a ton more CPU time than needed by visiting proxies every
time it needed to check for surface usage.

Note also, the fSampledProxies does indeed usually contain many
duplicates in our SKPs. Sometimes 3 or 4x. I may experiment with
using a hash set as suggested by a comment.

Bug: skia:10877
Change-Id: Iae01ed16d7b4c7cda343d37ab8fd6147ae6c65e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409416
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2 files changed