| 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_CONTEXT_EGL_H_ | 5 #ifndef UI_GL_GL_CONTEXT_EGL_H_ |
| 6 #define UI_GL_GL_CONTEXT_EGL_H_ | 6 #define UI_GL_GL_CONTEXT_EGL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ui/gl/gl_context.h" | 12 #include "ui/gl/gl_context.h" |
| 13 | 13 |
| 14 typedef void* EGLContext; | 14 typedef void* EGLContext; |
| 15 typedef void* EGLDisplay; | 15 typedef void* EGLDisplay; |
| 16 typedef void* EGLConfig; | 16 typedef void* EGLConfig; |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 | 19 |
| 20 class GLSurface; | 20 class GLSurface; |
| 21 | 21 |
| 22 // Encapsulates an EGL OpenGL ES context. | 22 // Encapsulates an EGL OpenGL ES context. |
| 23 class GLContextEGL : public GLContext { | 23 class GLContextEGL : public GLContext { |
| 24 public: | 24 public: |
| 25 explicit GLContextEGL(GLShareGroup* share_group); | 25 explicit GLContextEGL(GLShareGroup* share_group); |
| 26 virtual ~GLContextEGL(); | |
| 27 | 26 |
| 28 // Implement GLContext. | 27 // Implement GLContext. |
| 29 virtual bool Initialize( | 28 virtual bool Initialize( |
| 30 GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; | 29 GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; |
| 31 virtual void Destroy() OVERRIDE; | 30 virtual void Destroy() OVERRIDE; |
| 32 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; | 31 virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; |
| 33 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; | 32 virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; |
| 34 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; | 33 virtual bool IsCurrent(GLSurface* surface) OVERRIDE; |
| 35 virtual void* GetHandle() OVERRIDE; | 34 virtual void* GetHandle() OVERRIDE; |
| 36 virtual void SetSwapInterval(int interval) OVERRIDE; | 35 virtual void SetSwapInterval(int interval) OVERRIDE; |
| 37 virtual std::string GetExtensions() OVERRIDE; | 36 virtual std::string GetExtensions() OVERRIDE; |
| 38 | 37 |
| 38 protected: |
| 39 virtual ~GLContextEGL(); |
| 40 |
| 39 private: | 41 private: |
| 40 EGLContext context_; | 42 EGLContext context_; |
| 41 EGLDisplay display_; | 43 EGLDisplay display_; |
| 42 EGLConfig config_; | 44 EGLConfig config_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(GLContextEGL); | 46 DISALLOW_COPY_AND_ASSIGN(GLContextEGL); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 } // namespace gfx | 49 } // namespace gfx |
| 48 | 50 |
| 49 #endif // UI_GL_GL_CONTEXT_EGL_H_ | 51 #endif // UI_GL_GL_CONTEXT_EGL_H_ |
| OLD | NEW |