diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-08 22:43:26 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-08 22:43:26 +0000 |
commit | c9addd1a9ec9bd14e242268b4a7e368e4bd377d3 (patch) | |
tree | aea96e5929800059075e2268d850e8f12285dd11 /cc/test/test_web_graphics_context_3d.h | |
parent | 384cc73aee79d33baa743398c583adba702ce5e6 (diff) | |
download | chromium_src-c9addd1a9ec9bd14e242268b4a7e368e4bd377d3.zip chromium_src-c9addd1a9ec9bd14e242268b4a7e368e4bd377d3.tar.gz chromium_src-c9addd1a9ec9bd14e242268b4a7e368e4bd377d3.tar.bz2 |
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
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.h')
-rw-r--r-- | cc/test/test_web_graphics_context_3d.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h index 54cf543..b74a6be 100644 --- a/cc/test/test_web_graphics_context_3d.h +++ b/cc/test/test_web_graphics_context_3d.h @@ -31,8 +31,6 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D { virtual ~TestWebGraphicsContext3D(); - virtual bool makeContextCurrent(); - virtual void reshapeWithScaleFactor( int width, int height, float scale_factor); @@ -167,9 +165,8 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D { return test_capabilities_; } - // When set, MakeCurrent() will fail after this many times. - void set_times_make_current_succeeds(int times) { - times_make_current_succeeds_ = times; + void set_context_lost(bool context_lost) { + context_lost_ = context_lost; } void set_times_bind_texture_succeeds(int times) { times_bind_texture_succeeds_ = times; @@ -334,7 +331,6 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D { unsigned context_id_; Attributes attributes_; ContextProvider::Capabilities test_capabilities_; - int times_make_current_succeeds_; int times_bind_texture_succeeds_; int times_end_query_succeeds_; int times_gen_mailbox_succeeds_; |