OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GL_GL_SURFACE_WGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_WGL_H_ |
6 #define UI_GL_GL_SURFACE_WGL_H_ | 6 #define UI_GL_GL_SURFACE_WGL_H_ |
7 | 7 |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
9 #include "ui/gl/gl_surface.h" | 9 #include "ui/gl/gl_surface.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // A surface used to render to a view. | 31 // A surface used to render to a view. |
32 class NativeViewGLSurfaceWGL : public GLSurfaceWGL { | 32 class NativeViewGLSurfaceWGL : public GLSurfaceWGL { |
33 public: | 33 public: |
34 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window); | 34 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window); |
35 | 35 |
36 // Implement GLSurface. | 36 // Implement GLSurface. |
37 bool Initialize() override; | 37 bool Initialize() override; |
38 void Destroy() override; | 38 void Destroy() override; |
39 bool IsOffscreen() override; | 39 bool IsOffscreen() override; |
40 bool SwapBuffers() override; | 40 gfx::SwapResult SwapBuffers() override; |
41 gfx::Size GetSize() override; | 41 gfx::Size GetSize() override; |
42 void* GetHandle() override; | 42 void* GetHandle() override; |
43 | 43 |
44 private: | 44 private: |
45 ~NativeViewGLSurfaceWGL() override; | 45 ~NativeViewGLSurfaceWGL() override; |
46 | 46 |
47 gfx::AcceleratedWidget window_; | 47 gfx::AcceleratedWidget window_; |
48 gfx::AcceleratedWidget child_window_; | 48 gfx::AcceleratedWidget child_window_; |
49 HDC device_context_; | 49 HDC device_context_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); | 51 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); |
52 }; | 52 }; |
53 | 53 |
54 | 54 |
55 // A surface used to render to an offscreen pbuffer. | 55 // A surface used to render to an offscreen pbuffer. |
56 class PbufferGLSurfaceWGL : public GLSurfaceWGL { | 56 class PbufferGLSurfaceWGL : public GLSurfaceWGL { |
57 public: | 57 public: |
58 explicit PbufferGLSurfaceWGL(const gfx::Size& size); | 58 explicit PbufferGLSurfaceWGL(const gfx::Size& size); |
59 | 59 |
60 // Implement GLSurface. | 60 // Implement GLSurface. |
61 bool Initialize() override; | 61 bool Initialize() override; |
62 void Destroy() override; | 62 void Destroy() override; |
63 bool IsOffscreen() override; | 63 bool IsOffscreen() override; |
64 bool SwapBuffers() override; | 64 gfx::SwapResult SwapBuffers() override; |
65 gfx::Size GetSize() override; | 65 gfx::Size GetSize() override; |
66 void* GetHandle() override; | 66 void* GetHandle() override; |
67 | 67 |
68 private: | 68 private: |
69 ~PbufferGLSurfaceWGL() override; | 69 ~PbufferGLSurfaceWGL() override; |
70 | 70 |
71 gfx::Size size_; | 71 gfx::Size size_; |
72 HDC device_context_; | 72 HDC device_context_; |
73 void* pbuffer_; | 73 void* pbuffer_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); | 75 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace gfx | 78 } // namespace gfx |
79 | 79 |
80 #endif // UI_GL_GL_SURFACE_WGL_H_ | 80 #endif // UI_GL_GL_SURFACE_WGL_H_ |
OLD | NEW |