Commit 6e2a612d authored by sievers@chromium.org's avatar sievers@chromium.org

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
parent 8a69cf9e
...@@ -114,10 +114,7 @@ bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { ...@@ -114,10 +114,7 @@ bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {
return true; return true;
} }
if (!context_.get()) { context_ = context;
DCHECK(helper_->stub());
context_ = helper_->stub()->decoder()->GetGLContext();
}
if (!fbo_id_) { if (!fbo_id_) {
glGenFramebuffersEXT(1, &fbo_id_); glGenFramebuffersEXT(1, &fbo_id_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment