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

Unified Diff: ui/gfx/compositor/compositor_gl.cc

Issue 8418035: Fix gl context change on dropping a texture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as per sky Created 9 years, 1 month 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
« ui/gfx/compositor/compositor_gl.h ('K') | « ui/gfx/compositor/compositor_gl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor_gl.cc
diff --git a/ui/gfx/compositor/compositor_gl.cc b/ui/gfx/compositor/compositor_gl.cc
index c28195c5a74411bf77f3df52ee4b605acd16be55..2894b3468df0797d429da9714110af42e7fe5411 100644
--- a/ui/gfx/compositor/compositor_gl.cc
+++ b/ui/gfx/compositor/compositor_gl.cc
@@ -304,6 +304,10 @@ bool SharedResourcesGL::MakeSharedContextCurrent() {
return context_->MakeCurrent(surface_.get());
}
+gfx::ScopedMakeCurrent* SharedResourcesGL::GetScopedMakeCurrent() {
+ return new gfx::ScopedMakeCurrent(context_.get(), surface_.get());
+}
+
scoped_refptr<gfx::GLContext> SharedResourcesGL::CreateContext(
gfx::GLSurface* surface) {
if (initialized_)
@@ -329,7 +333,7 @@ TextureGL::~TextureGL() {
if (texture_id_) {
SharedResourcesGL* instance = SharedResourcesGL::GetInstance();
DCHECK(instance);
- instance->MakeSharedContextCurrent();
+ scoped_ptr<gfx::ScopedMakeCurrent> bind(instance->GetScopedMakeCurrent());
glDeleteTextures(1, &texture_id_);
}
}
« ui/gfx/compositor/compositor_gl.h ('K') | « ui/gfx/compositor/compositor_gl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698