Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1440)

Unified Diff: content/common/gpu/texture_image_transport_surface.cc

Issue 221433004: gpu: Bind dummy GL API when no context is current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix two gpu unittests Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/texture_image_transport_surface.cc
diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc
index 45ce615c4951ca37627558a6e40d23c037acc788..413d1d4d636770a212bfd4c5618d39143e53b743 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -30,8 +30,7 @@ namespace content {
namespace {
bool IsContextValid(ImageTransportHelper* helper) {
- return helper->stub()->decoder()->GetGLContext()->IsCurrent(NULL) ||
- helper->stub()->decoder()->WasContextLost();
+ return helper->stub()->decoder()->GetGLContext()->IsCurrent(NULL);
}
} // namespace
@@ -175,19 +174,26 @@ void TextureImageTransportSurface::OnResize(gfx::Size size,
}
void TextureImageTransportSurface::OnWillDestroyStub() {
- DCHECK(IsContextValid(helper_.get()));
+ bool have_context = IsContextValid(helper_.get());
helper_->stub()->RemoveDestructionObserver(this);
// We are losing the stub owning us, this is our last chance to clean up the
// resources we allocated in the stub's context.
- ReleaseBackTexture();
- ReleaseFrontTexture();
+ if (have_context) {
+ ReleaseBackTexture();
+ ReleaseFrontTexture();
+ } else {
+ backbuffer_ = NULL;
+ back_mailbox_ = Mailbox();
+ frontbuffer_ = NULL;
+ front_mailbox_ = Mailbox();
+ }
- if (fbo_id_) {
+ if (fbo_id_ && have_context) {
glDeleteFramebuffersEXT(1, &fbo_id_);
CHECK_GL_ERROR();
- fbo_id_ = 0;
}
+ fbo_id_ = 0;
stub_destroyed_ = true;
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698