OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_GFX_GL_GL_CONTEXT_EGL_H_ | |
6 #define UI_GFX_GL_GL_CONTEXT_EGL_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "ui/gfx/gl/gl_context.h" | |
13 | |
14 typedef void* EGLContext; | |
15 typedef void* EGLDisplay; | |
16 typedef void* EGLConfig; | |
17 | |
18 namespace gfx { | |
19 | |
20 class GLSurface; | |
21 | |
22 // Encapsulates an EGL OpenGL ES context. | |
23 class GLContextEGL : public GLContext { | |
24 public: | |
25 explicit GLContextEGL(GLShareGroup* share_group); | |
26 virtual ~GLContextEGL(); | |
27 | |
28 // Implement GLContext. | |
29 virtual bool Initialize( | |
30 GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; | |
31 virtual void Destroy() OVERRIDE; | |
32 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; | |
33 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; | |
34 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; | |
35 virtual void* GetHandle() OVERRIDE; | |
36 virtual void SetSwapInterval(int interval) OVERRIDE; | |
37 virtual std::string GetExtensions() OVERRIDE; | |
38 | |
39 private: | |
40 EGLContext context_; | |
41 EGLDisplay display_; | |
42 EGLConfig config_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(GLContextEGL); | |
45 }; | |
46 | |
47 } // namespace gfx | |
48 | |
49 #endif // UI_GFX_GL_GL_CONTEXT_EGL_H_ | |
OLD | NEW |