| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gl/gl_export.h" | 10 #include "ui/gl/gl_export.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 private: | 30 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGL); | 31 DISALLOW_COPY_AND_ASSIGN(GLSurfaceWGL); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // A surface used to render to a view. | 34 // A surface used to render to a view. |
| 35 class GL_EXPORT NativeViewGLSurfaceWGL : public GLSurfaceWGL { | 35 class GL_EXPORT NativeViewGLSurfaceWGL : public GLSurfaceWGL { |
| 36 public: | 36 public: |
| 37 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window); | 37 explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window); |
| 38 | 38 |
| 39 // Implement GLSurface. | 39 // Implement GLSurface. |
| 40 bool Initialize(GLSurface::Format format) override; | 40 bool Initialize(GLSurfaceFormat format) override; |
| 41 void Destroy() override; | 41 void Destroy() override; |
| 42 bool Resize(const gfx::Size& size, | 42 bool Resize(const gfx::Size& size, |
| 43 float scale_factor, | 43 float scale_factor, |
| 44 bool has_alpha) override; | 44 bool has_alpha) override; |
| 45 bool Recreate() override; | 45 bool Recreate() override; |
| 46 bool IsOffscreen() override; | 46 bool IsOffscreen() override; |
| 47 gfx::SwapResult SwapBuffers() override; | 47 gfx::SwapResult SwapBuffers() override; |
| 48 gfx::Size GetSize() override; | 48 gfx::Size GetSize() override; |
| 49 void* GetHandle() override; | 49 void* GetHandle() override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 ~NativeViewGLSurfaceWGL() override; | 52 ~NativeViewGLSurfaceWGL() override; |
| 53 | 53 |
| 54 GLSurface::Format format_ = GLSurface::SURFACE_DEFAULT; | 54 GLSurfaceFormat format_; |
| 55 | 55 |
| 56 gfx::AcceleratedWidget window_; | 56 gfx::AcceleratedWidget window_; |
| 57 gfx::AcceleratedWidget child_window_; | 57 gfx::AcceleratedWidget child_window_; |
| 58 HDC device_context_; | 58 HDC device_context_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); | 60 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 | 63 |
| 64 // A surface used to render to an offscreen pbuffer. | 64 // A surface used to render to an offscreen pbuffer. |
| 65 class GL_EXPORT PbufferGLSurfaceWGL : public GLSurfaceWGL { | 65 class GL_EXPORT PbufferGLSurfaceWGL : public GLSurfaceWGL { |
| 66 public: | 66 public: |
| 67 explicit PbufferGLSurfaceWGL(const gfx::Size& size); | 67 explicit PbufferGLSurfaceWGL(const gfx::Size& size); |
| 68 | 68 |
| 69 // Implement GLSurface. | 69 // Implement GLSurface. |
| 70 bool Initialize(GLSurface::Format format) override; | 70 bool Initialize(GLSurfaceFormat format) override; |
| 71 void Destroy() override; | 71 void Destroy() override; |
| 72 bool IsOffscreen() override; | 72 bool IsOffscreen() override; |
| 73 gfx::SwapResult SwapBuffers() override; | 73 gfx::SwapResult SwapBuffers() override; |
| 74 gfx::Size GetSize() override; | 74 gfx::Size GetSize() override; |
| 75 void* GetHandle() override; | 75 void* GetHandle() override; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 ~PbufferGLSurfaceWGL() override; | 78 ~PbufferGLSurfaceWGL() override; |
| 79 | 79 |
| 80 gfx::Size size_; | 80 gfx::Size size_; |
| 81 HDC device_context_; | 81 HDC device_context_; |
| 82 void* pbuffer_; | 82 void* pbuffer_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); | 84 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace gl | 87 } // namespace gl |
| 88 | 88 |
| 89 #endif // UI_GL_GL_SURFACE_WGL_H_ | 89 #endif // UI_GL_GL_SURFACE_WGL_H_ |
| OLD | NEW |