diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-06 19:44:57 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-06 19:44:57 +0000 |
commit | f5931d4341bc85b6f987c2b664154cc047f2b570 (patch) | |
tree | 345c258cb9134399e1770e8d102b6305e20e5cd7 /cc/test/test_context_provider.cc | |
parent | 91dcae34f2f3c83e2bdddb9908c5ce394069e4bf (diff) | |
download | chromium_src-f5931d4341bc85b6f987c2b664154cc047f2b570.zip chromium_src-f5931d4341bc85b6f987c2b664154cc047f2b570.tar.gz chromium_src-f5931d4341bc85b6f987c2b664154cc047f2b570.tar.bz2 |
Remove WGC3D::isContextLost references from cc
The notion of whether a context is lost is a property of both the gpu::
context itself and the system providing it. For instance, the content
context provider checks if there is an error in the context or if the IPC
channel backing the command buffer is down. Thus, asking if a context is
lost really should go through the ContextProvider. This patch routes all
lost context checks from cc through the ContextProvider.
Unfortunately, this required reworking the program initialization code
considerably due to the way some DCHECKs were written. The new model is that
the program binding itself is inert upon construction and all initialization
is done in the Initialize() call. This call is still made eagerly for some
expected-to-be-common programs and lazily for the rest. This patch moves
when the linkProgram() call is issued slightly for the eagerly compiled programs,
but it shouldn't make any difference in practice.
This patch also revamps TextureLayerClient to hide the backing context since
cc only makes two calls (check for loss and insert rate limiting token) on
the client's context.
R=piman
BUG=181120
Review URL: https://codereview.chromium.org/51653008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_context_provider.cc')
-rw-r--r-- | cc/test/test_context_provider.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc index 61660ea..f1cdbb6 100644 --- a/cc/test/test_context_provider.cc +++ b/cc/test/test_context_provider.cc @@ -71,7 +71,9 @@ scoped_refptr<TestContextProvider> TestContextProvider::Create( TestContextProvider::TestContextProvider( scoped_ptr<TestWebGraphicsContext3D> context) - : context3d_(context.Pass()), bound_(false), destroyed_(false) { + : context3d_(context.Pass()), + bound_(false), + destroyed_(false) { DCHECK(main_thread_checker_.CalledOnValidThread()); DCHECK(context3d_); context_thread_checker_.DetachFromThread(); @@ -139,6 +141,14 @@ class GrContext* TestContextProvider::GrContext() { return NULL; } +bool TestContextProvider::IsContextLost() { + DCHECK(context3d_); + DCHECK(bound_); + DCHECK(context_thread_checker_.CalledOnValidThread()); + + return context3d_->isContextLost(); +} + void TestContextProvider::VerifyContexts() { DCHECK(context3d_); DCHECK(bound_); @@ -185,7 +195,6 @@ TestWebGraphicsContext3D* TestContextProvider::TestContext3d() { TestWebGraphicsContext3D* TestContextProvider::UnboundTestContext3d() { DCHECK(context3d_); - DCHECK(context_thread_checker_.CalledOnValidThread()); return context3d_.get(); } |