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

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

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month 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
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_CONTEXT_WGL_H_ 5 #ifndef UI_GL_GL_CONTEXT_WGL_H_
6 #define UI_GL_GL_CONTEXT_WGL_H_ 6 #define UI_GL_GL_CONTEXT_WGL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/gfx/native_widget_types.h" 11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/gl/gl_context.h" 12 #include "ui/gl/gl_context.h"
13 #include "ui/gl/gl_export.h" 13 #include "ui/gl/gl_export.h"
14 14
15 namespace gl { 15 namespace gl {
16 16
17 class GLSurface; 17 class GLSurface;
18 18
19 // This class is a wrapper around a GL context. 19 // This class is a wrapper around a GL context.
20 class GL_EXPORT GLContextWGL : public GLContextReal { 20 class GL_EXPORT GLContextWGL : public GLContextReal {
21 public: 21 public:
22 explicit GLContextWGL(GLShareGroup* share_group); 22 explicit GLContextWGL(GLShareGroup* share_group);
23 23
24 // Implement GLContext. 24 // Implement GLContext.
25 bool Initialize(GLSurface* compatible_surface, 25 bool Initialize(GLSurface* compatible_surface,
26 GpuPreference gpu_preference) override; 26 const GLContextAttribs& attribs) override;
27 bool MakeCurrent(GLSurface* surface) override; 27 bool MakeCurrent(GLSurface* surface) override;
28 void ReleaseCurrent(GLSurface* surface) override; 28 void ReleaseCurrent(GLSurface* surface) override;
29 bool IsCurrent(GLSurface* surface) override; 29 bool IsCurrent(GLSurface* surface) override;
30 void* GetHandle() override; 30 void* GetHandle() override;
31 void OnSetSwapInterval(int interval) override; 31 void OnSetSwapInterval(int interval) override;
32 std::string GetExtensions() override; 32 std::string GetExtensions() override;
33 33
34 private: 34 private:
35 ~GLContextWGL() override; 35 ~GLContextWGL() override;
36 void Destroy(); 36 void Destroy();
37 37
38 HGLRC context_; 38 HGLRC context_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(GLContextWGL); 40 DISALLOW_COPY_AND_ASSIGN(GLContextWGL);
41 }; 41 };
42 42
43 } // namespace gl 43 } // namespace gl
44 44
45 #endif // UI_GL_GL_CONTEXT_WGL_H_ 45 #endif // UI_GL_GL_CONTEXT_WGL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698