Rely on lost context callbacks intead of polling
commitc9addd1a9ec9bd14e242268b4a7e368e4bd377d3
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sun, 8 Dec 2013 22:43:26 +0000 (8 22:43 +0000)
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sun, 8 Dec 2013 22:43:26 +0000 (8 22:43 +0000)
treeaea96e5929800059075e2268d850e8f12285dd11
parent384cc73aee79d33baa743398c583adba702ce5e6
Rely on lost context callbacks intead of polling

The compositor is notified of a lost context event through the ContextProvider's
lost context callback. We also had various pieces of code that expilcitly polled
the context to see if it was still alive and attempted to fail faster if the context
was lost. This logic is not really necessary, however, since on a lost context the
callback will always be invoked sooner or later and these early exit + recover paths
add significantly complexity to the compositor and the context bindings.

This strips out code that polls for a lost context inside cc and instead performs
recovery on the lost context callback.

This also stops attempting to make the compositor's context current before making calls.
Since we use the object-oriented C++ bindings to talk to the context implementation,
there's no need to update the current context pointer in TLS in order to issue GL calls.
Ganesh still uses the TLS pointer for its bindings so we do have an entry point to make
that context current when necessary.

BUG=181120

Review URL: https://codereview.chromium.org/107193003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239415 0039d316-1c4b-4281-b951-d872f2087c98
17 files changed:
cc/output/context_provider.h
cc/output/delegating_renderer.cc
cc/output/gl_renderer.cc
cc/output/gl_renderer.h
cc/output/gl_renderer_unittest.cc
cc/output/output_surface_unittest.cc
cc/resources/resource_provider.cc
cc/test/test_context_provider.cc
cc/test/test_context_provider.h
cc/test/test_web_graphics_context_3d.cc
cc/test/test_web_graphics_context_3d.h
cc/trees/layer_tree_host_impl_unittest.cc
cc/trees/layer_tree_host_unittest_context.cc
content/common/gpu/client/context_provider_command_buffer.cc
content/common/gpu/client/context_provider_command_buffer.h
webkit/common/gpu/context_provider_in_process.cc
webkit/common/gpu/context_provider_in_process.h