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

Side by Side Diff: ui/gl/gl_surface_glx.h

Issue 2347383002: X11: Use better visuals for OpenGL (Closed)
Patch Set: Fix various tests Created 4 years, 2 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
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 float scale_factor, 65 float scale_factor,
66 bool has_alpha) override; 66 bool has_alpha) override;
67 bool IsOffscreen() override; 67 bool IsOffscreen() override;
68 gfx::SwapResult SwapBuffers() override; 68 gfx::SwapResult SwapBuffers() override;
69 gfx::Size GetSize() override; 69 gfx::Size GetSize() override;
70 void* GetHandle() override; 70 void* GetHandle() override;
71 bool SupportsPostSubBuffer() override; 71 bool SupportsPostSubBuffer() override;
72 void* GetConfig() override; 72 void* GetConfig() override;
73 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; 73 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
74 gfx::VSyncProvider* GetVSyncProvider() override; 74 gfx::VSyncProvider* GetVSyncProvider() override;
75 VisualID GetVisualID() const { return visual_id_; }
75 76
76 protected: 77 protected:
77 ~NativeViewGLSurfaceGLX() override; 78 ~NativeViewGLSurfaceGLX() override;
78 79
79 // Handle registering and unregistering for Expose events. 80 // Handle registering and unregistering for Expose events.
80 virtual void RegisterEvents() = 0; 81 virtual void RegisterEvents() = 0;
81 virtual void UnregisterEvents() = 0; 82 virtual void UnregisterEvents() = 0;
82 83
83 // Forwards Expose event to child window. 84 // Forwards Expose event to child window.
84 void ForwardExposeEvent(XEvent* xevent); 85 void ForwardExposeEvent(XEvent* xevent);
(...skipping 11 matching lines...) Expand all
96 gfx::AcceleratedWidget parent_window_; 97 gfx::AcceleratedWidget parent_window_;
97 98
98 // Child window, used to control resizes so that they're in-order with GL. 99 // Child window, used to control resizes so that they're in-order with GL.
99 gfx::AcceleratedWidget window_; 100 gfx::AcceleratedWidget window_;
100 101
101 // GLXDrawable for the window. 102 // GLXDrawable for the window.
102 GLXWindow glx_window_; 103 GLXWindow glx_window_;
103 104
104 GLXFBConfig config_; 105 GLXFBConfig config_;
105 gfx::Size size_; 106 gfx::Size size_;
107 VisualID visual_id_;
106 108
107 std::unique_ptr<gfx::VSyncProvider> vsync_provider_; 109 std::unique_ptr<gfx::VSyncProvider> vsync_provider_;
108 110
109 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); 111 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX);
110 }; 112 };
111 113
112 // A surface used to render to an offscreen pbuffer. 114 // A surface used to render to an offscreen pbuffer.
113 class GL_EXPORT UnmappedNativeViewGLSurfaceGLX : public GLSurfaceGLX { 115 class GL_EXPORT UnmappedNativeViewGLSurfaceGLX : public GLSurfaceGLX {
114 public: 116 public:
115 explicit UnmappedNativeViewGLSurfaceGLX(const gfx::Size& size); 117 explicit UnmappedNativeViewGLSurfaceGLX(const gfx::Size& size);
(...skipping 18 matching lines...) Expand all
134 136
135 // GLXDrawable for the window. 137 // GLXDrawable for the window.
136 GLXWindow glx_window_; 138 GLXWindow glx_window_;
137 139
138 DISALLOW_COPY_AND_ASSIGN(UnmappedNativeViewGLSurfaceGLX); 140 DISALLOW_COPY_AND_ASSIGN(UnmappedNativeViewGLSurfaceGLX);
139 }; 141 };
140 142
141 } // namespace gl 143 } // namespace gl
142 144
143 #endif // UI_GL_GL_SURFACE_GLX_H_ 145 #endif // UI_GL_GL_SURFACE_GLX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698