blob: 69c7e5c06dab3cf65fb2282958b6ed8bdc45d8e1 [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
avi739878c2015-12-24 18:06:1710#include "base/macros.h"
[email protected]f62a5ab2011-05-23 20:34:1511#include "ui/gfx/native_widget_types.h"
[email protected]c9e2cbbb2012-05-12 21:17:2712#include "ui/gl/gl_context.h"
[email protected]a3e1b632011-04-15 21:35:1213
14namespace gfx {
15
[email protected]f62a5ab2011-05-23 20:34:1516class GLSurface;
17
[email protected]a3e1b632011-04-15 21:35:1218// This class is a wrapper around a GL context.
[email protected]1e9c0c82013-06-06 14:59:2419class GLContextWGL : public GLContextReal {
[email protected]a3e1b632011-04-15 21:35:1220 public:
[email protected]7196e012011-06-16 20:54:5321 explicit GLContextWGL(GLShareGroup* share_group);
[email protected]a3e1b632011-04-15 21:35:1222
[email protected]a3e1b632011-04-15 21:35:1223 // Implement GLContext.
dchengad8e1af22015-04-21 21:01:2224 bool Initialize(GLSurface* compatible_surface,
25 GpuPreference gpu_preference) override;
dchengad8e1af22015-04-21 21:01:2226 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;
piman74a0f5ae2015-07-27 23:40:4135 void Destroy();
thakisefa363a2015-05-02 01:28:4436
[email protected]a3e1b632011-04-15 21:35:1237 HGLRC context_;
38
39 DISALLOW_COPY_AND_ASSIGN(GLContextWGL);
40};
41
42} // namespace gfx
43
[email protected]c9e2cbbb2012-05-12 21:17:2744#endif // UI_GL_GL_CONTEXT_WGL_H_