Ensure that GLFence be destroyed while its context is current

Also only change the current context if it is necessary (jank has been
observed during context switch in traces).

Also also re-arrane the individual fence-polls to only do one poll,
and to trace each individual poll.

Bug: 863817
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Iaa7c4046d2bb59e4abdd27b9e2e4b311e85b7c99
Reviewed-on: https://chromium-review.googlesource.com/1141182
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576161}
1 file changed