From f5931d4341bc85b6f987c2b664154cc047f2b570 Mon Sep 17 00:00:00 2001 From: "jamesr@chromium.org" Date: Wed, 6 Nov 2013 19:44:57 +0000 Subject: 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 --- content/browser/aura/gpu_process_transport_factory.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'content/browser/aura') diff --git a/content/browser/aura/gpu_process_transport_factory.cc b/content/browser/aura/gpu_process_transport_factory.cc index 12bfd8c..be5fc24 100644 --- a/content/browser/aura/gpu_process_transport_factory.cc +++ b/content/browser/aura/gpu_process_transport_factory.cc @@ -67,6 +67,8 @@ class OwnedTexture : public ui::Texture, ImageTransportFactoryObserver { // ui::Texture overrides: virtual unsigned int PrepareTexture() OVERRIDE { + if (!host_context_ || host_context_->isContextLost()) + return 0u; return texture_id_; } -- cgit v1.1