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
3 // found in the LICENSE file.
5 #ifndef UI_GL_GL_SURFACE_WGL_H_
6 #define UI_GL_GL_SURFACE_WGL_H_
8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/gl/gl_surface.h"
13 // Base interface for WGL surfaces.
14 class GLSurfaceWGL
: public GLSurface
{
18 // Implement GLSurface.
19 void* GetDisplay() override
;
21 static bool InitializeOneOff();
22 static HDC
GetDisplayDC();
25 ~GLSurfaceWGL() override
;
28 DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGL
);
31 // A surface used to render to a view.
32 class NativeViewGLSurfaceWGL
: public GLSurfaceWGL
{
34 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window
);
36 // Implement GLSurface.
37 bool Initialize() override
;
38 void Destroy() override
;
39 bool IsOffscreen() override
;
40 bool SwapBuffers() override
;
41 gfx::Size
GetSize() override
;
42 void* GetHandle() override
;
45 ~NativeViewGLSurfaceWGL() override
;
47 gfx::AcceleratedWidget window_
;
48 gfx::AcceleratedWidget child_window_
;
51 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL
);
55 // A surface used to render to an offscreen pbuffer.
56 class PbufferGLSurfaceWGL
: public GLSurfaceWGL
{
58 explicit PbufferGLSurfaceWGL(const gfx::Size
& size
);
60 // Implement GLSurface.
61 bool Initialize() override
;
62 void Destroy() override
;
63 bool IsOffscreen() override
;
64 bool SwapBuffers() override
;
65 gfx::Size
GetSize() override
;
66 void* GetHandle() override
;
69 ~PbufferGLSurfaceWGL() override
;
75 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL
);
80 #endif // UI_GL_GL_SURFACE_WGL_H_