[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 | |||||
[email protected] | f62a5ab | 2011-05-23 20:34:15 | [diff] [blame] | 10 | #include "ui/gfx/native_widget_types.h" |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 11 | #include "ui/gl/gl_context.h" |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 12 | |
13 | namespace gfx { | ||||
14 | |||||
[email protected] | f62a5ab | 2011-05-23 20:34:15 | [diff] [blame] | 15 | class GLSurface; |
16 | |||||
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 17 | // This class is a wrapper around a GL context. |
[email protected] | 1e9c0c8 | 2013-06-06 14:59:24 | [diff] [blame] | 18 | class GLContextWGL : public GLContextReal { |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 19 | public: |
[email protected] | 7196e01 | 2011-06-16 20:54:53 | [diff] [blame] | 20 | explicit GLContextWGL(GLShareGroup* share_group); |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 21 | |
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 22 | // Implement GLContext. |
dcheng | ad8e1af2 | 2015-04-21 21:01:22 | [diff] [blame] | 23 | bool Initialize(GLSurface* compatible_surface, |
24 | GpuPreference gpu_preference) override; | ||||
25 | void Destroy() override; | ||||
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; |
35 | |||||
[email protected] | a3e1b63 | 2011-04-15 21:35:12 | [diff] [blame] | 36 | HGLRC context_; |
37 | |||||
38 | DISALLOW_COPY_AND_ASSIGN(GLContextWGL); | ||||
39 | }; | ||||
40 | |||||
41 | } // namespace gfx | ||||
42 | |||||
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 43 | #endif // UI_GL_GL_CONTEXT_WGL_H_ |