graphite: avoid insert empty recording in Query::End

Avoid snapping and inserting an empty recording just to attach a finish
proc. Inserting an empty recording is wasteful as Graphite would create
an empty command buffer. The proper way is to pass the finish proc to
submit(). If there is no new pending GPU work, submit() won't create
any command buffer, but it will still correctly trigger the finish proc
after all previously submitted GPU work completes.

Bug: 491840505
Change-Id: Id5805a8937df217727cbbb6964091283c931eebf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7683634
Reviewed-by: Michael Ludwig <[email protected]>
Commit-Queue: Colin Blundell <[email protected]>
Auto-Submit: Quyen Le <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1601944}
NOKEYCHECK=True
GitOrigin-RevId: c35d20f510250b7e18fe11364ba1e1c476f29156
3 files changed