blob: ff0aae0d96f98583d0e14b48d4e3d3ae04fccf44 [file] [log] [blame]
[email protected]c9e2cbbb2012-05-12 21:17:271// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]a3e1b632011-04-15 21:35:122// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]c9e2cbbb2012-05-12 21:17:275#ifndef UI_GL_GL_CONTEXT_WGL_H_
6#define UI_GL_GL_CONTEXT_WGL_H_
[email protected]a3e1b632011-04-15 21:35:127
8#include <string>
9
[email protected]f62a5ab2011-05-23 20:34:1510#include "ui/gfx/native_widget_types.h"
[email protected]c9e2cbbb2012-05-12 21:17:2711#include "ui/gl/gl_context.h"
[email protected]a3e1b632011-04-15 21:35:1212
13namespace gfx {
14
[email protected]f62a5ab2011-05-23 20:34:1515class GLSurface;
16
[email protected]a3e1b632011-04-15 21:35:1217// This class is a wrapper around a GL context.
[email protected]1e9c0c82013-06-06 14:59:2418class GLContextWGL : public GLContextReal {
[email protected]a3e1b632011-04-15 21:35:1219 public:
[email protected]7196e012011-06-16 20:54:5320 explicit GLContextWGL(GLShareGroup* share_group);
[email protected]a3e1b632011-04-15 21:35:1221
[email protected]a3e1b632011-04-15 21:35:1222 // Implement GLContext.
dchengad8e1af22015-04-21 21:01:2223 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]a3e1b632011-04-15 21:35:1232
33 private:
thakisefa363a2015-05-02 01:28:4434 ~GLContextWGL() override;
35
[email protected]a3e1b632011-04-15 21:35:1236 HGLRC context_;
37
38 DISALLOW_COPY_AND_ASSIGN(GLContextWGL);
39};
40
41} // namespace gfx
42
[email protected]c9e2cbbb2012-05-12 21:17:2743#endif // UI_GL_GL_CONTEXT_WGL_H_