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

Side by Side 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: Add missing OVERRIDE 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gl/gl_surface_glx.cc » ('j') | ui/gl/gl_surface_glx.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GL_GL_SURFACE_GLX_H_ 5 #ifndef UI_GL_GL_SURFACE_GLX_H_
6 #define UI_GL_GL_SURFACE_GLX_H_ 6 #define UI_GL_GL_SURFACE_GLX_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 virtual void* GetHandle() OVERRIDE; 62 virtual void* GetHandle() OVERRIDE;
63 virtual std::string GetExtensions() OVERRIDE; 63 virtual std::string GetExtensions() OVERRIDE;
64 virtual void* GetConfig() OVERRIDE; 64 virtual void* GetConfig() OVERRIDE;
65 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; 65 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
66 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; 66 virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
67 67
68 protected: 68 protected:
69 NativeViewGLSurfaceGLX(); 69 NativeViewGLSurfaceGLX();
70 virtual ~NativeViewGLSurfaceGLX(); 70 virtual ~NativeViewGLSurfaceGLX();
71 71
72 gfx::AcceleratedWidget window_; 72 private:
73 // The handle for the drawable to make current or swap.
74 gfx::AcceleratedWidget GetDrawableHandle() const;
73 75
74 private: 76 // Window passed in at creation. Always valid.
77 gfx::AcceleratedWidget parent_window_;
78
79 #if defined(TOOLKIT_GTK)
80 // Some NVIDIA drivers don't allow deleting GLX windows separately from their
81 // parent X windows. Work around this by creating a child X window to the
82 // window passed in to the constructor, creating the GLX window against the
83 // child window, and then destroying the child window to destroy the GLX
84 // window.
85 // http://crbug.com/145600
86 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE;
87 bool CreateChildWindow();
88 void DestroyChildWindow();
89
90 // Child window which is used with GLX, and is discarded when it is
91 // backgrounded.
92 gfx::AcceleratedWidget child_window_;
93
94 // Dummy 1x1 window which is supplied to glXMakeCurrent when making
95 // the context current while its output surface is destroyed.
96 gfx::AcceleratedWidget dummy_window_;
97 #endif
98
75 void* config_; 99 void* config_;
76 gfx::Size size_; 100 gfx::Size size_;
77 101
78 scoped_ptr<VSyncProvider> vsync_provider_; 102 scoped_ptr<VSyncProvider> vsync_provider_;
79 103
80 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); 104 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX);
81 }; 105 };
82 106
83 // A surface used to render to an offscreen pbuffer. 107 // A surface used to render to an offscreen pbuffer.
84 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { 108 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX {
(...skipping 16 matching lines...) Expand all
101 gfx::Size size_; 125 gfx::Size size_;
102 void* config_; 126 void* config_;
103 XID pbuffer_; 127 XID pbuffer_;
104 128
105 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); 129 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX);
106 }; 130 };
107 131
108 } // namespace gfx 132 } // namespace gfx
109 133
110 #endif // UI_GL_GL_SURFACE_GLX_H_ 134 #endif // UI_GL_GL_SURFACE_GLX_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_surface_glx.cc » ('j') | ui/gl/gl_surface_glx.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698