summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-14 06:56:09 +0000
committersievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-14 06:56:09 +0000
commit6e2a612da9dc1f5c6e814bef2461a8781f7390a9 (patch)
tree64ca806ceb9d47f56d451fdec75a5e8c066d7b33
parent8a69cf9e2b09c0938da65ef5721ef528d37208ff (diff)
downloadchromium_src-6e2a612da9dc1f5c6e814bef2461a8781f7390a9.zip
chromium_src-6e2a612da9dc1f5c6e814bef2461a8781f7390a9.tar.gz
chromium_src-6e2a612da9dc1f5c6e814bef2461a8781f7390a9.tar.bz2
Fix NULL ptr with short-lived TextureImageTransportSurfaces
When the surface is created from GpuCommandBufferStub, it is made current for the very first time while helper_->stub()->decoder()->GetGLContext() returns NULL (see order in GpuCommandBufferStub::OnInitialize()). If we then handle drawing and swapping of a frame while a) the context is still current and we avoid calling Surface::OnMakeCurrent() again b) the surface is destroyed right after with the ack pending, it is possible for context_ to be NULL in BufferPresentedImpl. With virtual contexts, this patch causes us to hold a reference to the real GL context instead now, which is fine because we only need the context to delete the backbuffer texture during destruction. BUG=169429 Review URL: https://codereview.chromium.org/12252028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182403 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/common/gpu/texture_image_transport_surface.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc
index e22082e..c0f1071 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -114,10 +114,7 @@ bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {
return true;
}
- if (!context_.get()) {
- DCHECK(helper_->stub());
- context_ = helper_->stub()->decoder()->GetGLContext();
- }
+ context_ = context;
if (!fbo_id_) {
glGenFramebuffersEXT(1, &fbo_id_);