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

Unified Diff: ui/gl/gl_surface_glx.h

Issue 23452026: Destroy GLX windows when they are backgrounded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make clang builds happy Created 7 years, 3 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 | « content/common/gpu/gpu_memory_manager.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_glx.h
diff --git a/ui/gl/gl_surface_glx.h b/ui/gl/gl_surface_glx.h
index 355b65d1c45e71a2b6ba1450cbaef9cbbad5b1a7..8e7bd1c0c784ff4a75ce61720f97998f5044c309 100644
--- a/ui/gl/gl_surface_glx.h
+++ b/ui/gl/gl_surface_glx.h
@@ -69,9 +69,41 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
NativeViewGLSurfaceGLX();
virtual ~NativeViewGLSurfaceGLX();
- gfx::AcceleratedWidget window_;
-
private:
+ // The handle for the drawable to make current or swap.
+ gfx::AcceleratedWidget GetDrawableHandle() const;
+
+ // Window passed in at creation. Always valid.
+ gfx::AcceleratedWidget parent_window_;
+
+#if defined(TOOLKIT_GTK)
+ // Some NVIDIA drivers don't allow deleting GLX windows separately from their
+ // parent X windows. Work around this by creating a child X window to the
+ // window passed in to the constructor, creating the GLX window against the
+ // child window, and then destroying the child window to destroy the GLX
+ // window.
+ // http://crbug.com/145600
+ void CreateChildWindow();
+ void DestroyChildWindow();
+
+ // Destroy the child window when both the front and back buffers are
+ // deallocated.
+ virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE;
+ virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE;
+ void AdjustBufferAllocation();
+
+ // Child window which is used with GLX, and is discarded when it is
+ // backgrounded.
+ gfx::AcceleratedWidget child_window_;
+
+ // Dummy 1x1 window which is supplied to glXMakeCurrent when making
+ // the context current while its output surface is destroyed.
+ gfx::AcceleratedWidget dummy_window_;
+
+ bool backbuffer_allocated_;
+ bool frontbuffer_allocated_;
+#endif
+
void* config_;
gfx::Size size_;
« no previous file with comments | « content/common/gpu/gpu_memory_manager.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698