canvas2d: Avoid gpu command buffer flushes for snapshots.

The shared image code path currently results in a flush each time the
resource is snapshotted. The primary source of this is resetting of the
GL filter each time the accelerated image is destroyed, so do it lazily
now when the resource is sent to the display compositor. This seems
more error prone but is consistent with the existing path.

R=fserb@chromium.org

Change-Id: Ia9c5223d15bfc35227e2a915b024d6cba3f02eb4
Bug: 974778
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663071
Commit-Queue: Antoine Labour <piman@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670659}
1 file changed