summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/compositor_gl.cc
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 18:11:52 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 18:11:52 +0000
commitf1555d8337c24a9b88d80c0ddde8d8865f737dc4 (patch)
treefe198192bba86033250ac397e55a24cd8f8bd57f /ui/gfx/compositor/compositor_gl.cc
parent4297cbeb84a2355ca73e6da0d6e3548c6d9792d4 (diff)
downloadchromium_src-f1555d8337c24a9b88d80c0ddde8d8865f737dc4.zip
chromium_src-f1555d8337c24a9b88d80c0ddde8d8865f737dc4.tar.gz
chromium_src-f1555d8337c24a9b88d80c0ddde8d8865f737dc4.tar.bz2
Fix gl context change on dropping a texture
As we are now recomputing holes in the draw path, we cannot change the GLContext. This patch resets the change in GL context incurred by DropTexture. BUG= TEST= Review URL: http://codereview.chromium.org/8418035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/compositor_gl.cc')
-rw-r--r--ui/gfx/compositor/compositor_gl.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/gfx/compositor/compositor_gl.cc b/ui/gfx/compositor/compositor_gl.cc
index 3d53d28..078556b 100644
--- a/ui/gfx/compositor/compositor_gl.cc
+++ b/ui/gfx/compositor/compositor_gl.cc
@@ -349,6 +349,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_)
@@ -374,7 +378,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_);
}
}