Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: ui/gl/gl_surface_wgl.h

Issue 2047283003: Move GLSurface creation from //ui/gl to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gl_context
Patch Set: Fix Ozone CreateViewGLSurface logic. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 static HDC GetDisplayDC(); 25 static HDC GetDisplayDC();
26 26
27 protected: 27 protected:
28 ~GLSurfaceWGL() override; 28 ~GLSurfaceWGL() override;
29 29
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 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(GLSurface::Format 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 GLSurface::Format format_ = GLSurface::SURFACE_DEFAULT;
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 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(GLSurface::Format 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_
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698