OLD | NEW |
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" |
11 #include "ui/base/x/x11_util.h" | 11 #include "ui/base/x/x11_util.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 #include "ui/gl/gl_export.h" | 14 #include "ui/gl/gl_export.h" |
15 #include "ui/gl/gl_surface.h" | 15 #include "ui/gl/gl_surface.h" |
16 #include "ui/gl/vsync_provider.h" | 16 #include "ui/gl/vsync_provider.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 | 19 |
| 20 class NativeViewXExposeEventForwarder; |
| 21 |
20 // Base class for GLX surfaces. | 22 // Base class for GLX surfaces. |
21 class GL_EXPORT GLSurfaceGLX : public GLSurface { | 23 class GL_EXPORT GLSurfaceGLX : public GLSurface { |
22 public: | 24 public: |
23 GLSurfaceGLX(); | 25 GLSurfaceGLX(); |
24 | 26 |
25 static bool InitializeOneOff(); | 27 static bool InitializeOneOff(); |
26 | 28 |
27 // These aren't particularly tied to surfaces, but since we already | 29 // These aren't particularly tied to surfaces, but since we already |
28 // have the static InitializeOneOff here, it's easiest to reuse its | 30 // have the static InitializeOneOff here, it's easiest to reuse its |
29 // initialization guards. | 31 // initialization guards. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 virtual void* GetHandle() OVERRIDE; | 64 virtual void* GetHandle() OVERRIDE; |
63 virtual std::string GetExtensions() OVERRIDE; | 65 virtual std::string GetExtensions() OVERRIDE; |
64 virtual void* GetConfig() OVERRIDE; | 66 virtual void* GetConfig() OVERRIDE; |
65 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 67 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
66 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; | 68 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; |
67 | 69 |
68 protected: | 70 protected: |
69 NativeViewGLSurfaceGLX(); | 71 NativeViewGLSurfaceGLX(); |
70 virtual ~NativeViewGLSurfaceGLX(); | 72 virtual ~NativeViewGLSurfaceGLX(); |
71 | 73 |
| 74 // Window that is passed down from the browser process. |
| 75 gfx::AcceleratedWidget parent_window_; |
72 gfx::AcceleratedWidget window_; | 76 gfx::AcceleratedWidget window_; |
73 | 77 |
74 private: | 78 private: |
75 void* config_; | 79 void* config_; |
76 gfx::Size size_; | 80 gfx::Size size_; |
77 | 81 |
78 scoped_ptr<VSyncProvider> vsync_provider_; | 82 scoped_ptr<VSyncProvider> vsync_provider_; |
| 83 scoped_ptr<NativeViewXExposeEventForwarder> event_forwarder_; |
79 | 84 |
80 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); | 85 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); |
81 }; | 86 }; |
82 | 87 |
83 // A surface used to render to an offscreen pbuffer. | 88 // A surface used to render to an offscreen pbuffer. |
84 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { | 89 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { |
85 public: | 90 public: |
86 explicit PbufferGLSurfaceGLX(const gfx::Size& size); | 91 explicit PbufferGLSurfaceGLX(const gfx::Size& size); |
87 | 92 |
88 // Implement GLSurfaceGLX. | 93 // Implement GLSurfaceGLX. |
(...skipping 12 matching lines...) Expand all Loading... |
101 gfx::Size size_; | 106 gfx::Size size_; |
102 void* config_; | 107 void* config_; |
103 XID pbuffer_; | 108 XID pbuffer_; |
104 | 109 |
105 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); | 110 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); |
106 }; | 111 }; |
107 | 112 |
108 } // namespace gfx | 113 } // namespace gfx |
109 | 114 |
110 #endif // UI_GL_GL_SURFACE_GLX_H_ | 115 #endif // UI_GL_GL_SURFACE_GLX_H_ |
OLD | NEW |