| 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 21 matching lines...) Expand all Loading... |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // A surface used to render to a view. | 34 // A surface used to render to a view. |
| 35 class NativeViewGLSurfaceWGL : public GLSurfaceWGL { | 35 class 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(GLSurface::Format format) override; |
| 41 void Destroy() override; | 41 void Destroy() override; |
| 42 bool Resize(const gfx::Size& size, |
| 43 float scale_factor, |
| 44 bool has_alpha) override; |
| 45 bool Recreate() override; |
| 42 bool IsOffscreen() override; | 46 bool IsOffscreen() override; |
| 43 gfx::SwapResult SwapBuffers() override; | 47 gfx::SwapResult SwapBuffers() override; |
| 44 gfx::Size GetSize() override; | 48 gfx::Size GetSize() override; |
| 45 void* GetHandle() override; | 49 void* GetHandle() override; |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 ~NativeViewGLSurfaceWGL() override; | 52 ~NativeViewGLSurfaceWGL() override; |
| 49 | 53 |
| 54 GLSurface::Format format_ = GLSurface::SURFACE_DEFAULT; |
| 55 |
| 50 gfx::AcceleratedWidget window_; | 56 gfx::AcceleratedWidget window_; |
| 51 gfx::AcceleratedWidget child_window_; | 57 gfx::AcceleratedWidget child_window_; |
| 52 HDC device_context_; | 58 HDC device_context_; |
| 53 | 59 |
| 54 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); | 60 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL); |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 | 63 |
| 58 // A surface used to render to an offscreen pbuffer. | 64 // A surface used to render to an offscreen pbuffer. |
| 59 class PbufferGLSurfaceWGL : public GLSurfaceWGL { | 65 class PbufferGLSurfaceWGL : public GLSurfaceWGL { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 gfx::Size size_; | 80 gfx::Size size_; |
| 75 HDC device_context_; | 81 HDC device_context_; |
| 76 void* pbuffer_; | 82 void* pbuffer_; |
| 77 | 83 |
| 78 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); | 84 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceWGL); |
| 79 }; | 85 }; |
| 80 | 86 |
| 81 } // namespace gfx | 87 } // namespace gfx |
| 82 | 88 |
| 83 #endif // UI_GL_GL_SURFACE_WGL_H_ | 89 #endif // UI_GL_GL_SURFACE_WGL_H_ |
| OLD | NEW |