[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 5 | #ifndef UI_GL_GL_CONTEXT_WGL_H_ |
6 | #define UI_GL_GL_CONTEXT_WGL_H_ | ||||
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 7 | |
8 | #include <string> | ||||
9 | |||||
avi | 739878c | 2015-12-24 18:06:17 | [diff] [blame] | 10 | #include "base/macros.h" |
[email protected] | f62a5ab | 2011-05-23 20:34:15 | [diff] [blame] | 11 | #include "ui/gfx/native_widget_types.h" |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 12 | #include "ui/gl/gl_context.h" |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 13 | |
14 | namespace gfx { | ||||
15 | |||||
[email protected] | f62a5ab | 2011-05-23 20:34:15 | [diff] [blame] | 16 | class GLSurface; |
17 | |||||
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 18 | // This class is a wrapper around a GL context. |
[email protected] | 1e9c0c8 | 2013-06-06 14:59:24 | [diff] [blame] | 19 | class GLContextWGL : public GLContextReal { |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 20 | public: |
[email protected] | 7196e01 | 2011-06-16 20:54:53 | [diff] [blame] | 21 | explicit GLContextWGL(GLShareGroup* share_group); |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 22 | |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 23 | // Implement GLContext. |
dcheng | ad8e1af2 | 2015-04-21 21:01:22 | [diff] [blame] | 24 | bool Initialize(GLSurface* compatible_surface, |
25 | GpuPreference gpu_preference) override; | ||||
dcheng | ad8e1af2 | 2015-04-21 21:01:22 | [diff] [blame] | 26 | bool MakeCurrent(GLSurface* surface) override; |
27 | void ReleaseCurrent(GLSurface* surface) override; | ||||
28 | bool IsCurrent(GLSurface* surface) override; | ||||
29 | void* GetHandle() override; | ||||
30 | void OnSetSwapInterval(int interval) override; | ||||
31 | std::string GetExtensions() override; | ||||
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 32 | |
33 | private: | ||||
thakis | efa363a | 2015-05-02 01:28:44 | [diff] [blame] | 34 | ~GLContextWGL() override; |
piman | 74a0f5ae | 2015-07-27 23:40:41 | [diff] [blame] | 35 | void Destroy(); |
thakis | efa363a | 2015-05-02 01:28:44 | [diff] [blame] | 36 | |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 37 | HGLRC context_; |
38 | |||||
39 | DISALLOW_COPY_AND_ASSIGN(GLContextWGL); | ||||
40 | }; | ||||
41 | |||||
42 | } // namespace gfx | ||||
43 | |||||
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 44 | #endif // UI_GL_GL_CONTEXT_WGL_H_ |