mac: Disable Address Book integration.
[chromium-blink-merge.git] / ui / gl / gl_surface_wgl.h
blob934e9f3a81f2b877219e84510c7bba91922e8f99
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"
11 namespace gfx {
13 // Base interface for WGL surfaces.
14 class GLSurfaceWGL : public GLSurface {
15 public:
16 GLSurfaceWGL();
18 // Implement GLSurface.
19 void* GetDisplay() override;
21 static bool InitializeOneOff();
22 static HDC GetDisplayDC();
24 protected:
25 ~GLSurfaceWGL() override;
27 private:
28 DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGL);
31 // A surface used to render to a view.
32 class NativeViewGLSurfaceWGL : public GLSurfaceWGL {
33 public:
34 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window);
36 // Implement GLSurface.
37 bool Initialize() override;
38 void Destroy() override;
39 bool IsOffscreen() override;
40 gfx::SwapResult SwapBuffers() override;
41 gfx::Size GetSize() override;
42 void* GetHandle() override;
44 private:
45 ~NativeViewGLSurfaceWGL() override;
47 gfx::AcceleratedWidget window_;
48 gfx::AcceleratedWidget child_window_;
49 HDC device_context_;
51 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL);
55 // A surface used to render to an offscreen pbuffer.
56 class PbufferGLSurfaceWGL : public GLSurfaceWGL {
57 public:
58 explicit PbufferGLSurfaceWGL(const gfx::Size& size);
60 // Implement GLSurface.
61 bool Initialize() override;
62 void Destroy() override;
63 bool IsOffscreen() override;
64 gfx::SwapResult SwapBuffers() override;
65 gfx::Size GetSize() override;
66 void* GetHandle() override;
68 private:
69 ~PbufferGLSurfaceWGL() override;
71 gfx::Size size_;
72 HDC device_context_;
73 void* pbuffer_;
75 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL);
78 } // namespace gfx
80 #endif // UI_GL_GL_SURFACE_WGL_H_