| 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_EGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_EGL_H_ |
| 6 #define UI_GL_GL_SURFACE_EGL_H_ | 6 #define UI_GL_GL_SURFACE_EGL_H_ |
| 7 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
| 17 #include "ui/gfx/vsync_provider.h" | 17 #include "ui/gfx/vsync_provider.h" |
| 18 #include "ui/gl/gl_bindings.h" | 18 #include "ui/gl/gl_bindings.h" |
| 19 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 | 22 |
| 23 // Get default EGL display for GLSurfaceEGL (differs by platform). |
| 24 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay(); |
| 25 |
| 23 // Interface for EGL surface. | 26 // Interface for EGL surface. |
| 24 class GL_EXPORT GLSurfaceEGL : public GLSurface { | 27 class GL_EXPORT GLSurfaceEGL : public GLSurface { |
| 25 public: | 28 public: |
| 26 GLSurfaceEGL(); | 29 GLSurfaceEGL(); |
| 27 | 30 |
| 28 // Implement GLSurface. | 31 // Implement GLSurface. |
| 29 virtual EGLDisplay GetDisplay() OVERRIDE; | 32 virtual EGLDisplay GetDisplay() OVERRIDE; |
| 30 | 33 |
| 31 static bool InitializeOneOff(); | 34 static bool InitializeOneOff(); |
| 32 static EGLDisplay GetHardwareDisplay(); | 35 static EGLDisplay GetHardwareDisplay(); |
| 33 static EGLNativeDisplayType GetNativeDisplay(); | 36 static EGLNativeDisplayType GetNativeDisplay(); |
| 34 | 37 |
| 35 // These aren't particularly tied to surfaces, but since we already | 38 // These aren't particularly tied to surfaces, but since we already |
| 36 // have the static InitializeOneOff here, it's easiest to reuse its | 39 // have the static InitializeOneOff here, it's easiest to reuse its |
| 37 // initialization guards. | 40 // initialization guards. |
| 38 static const char* GetEGLExtensions(); | 41 static const char* GetEGLExtensions(); |
| 39 static bool HasEGLExtension(const char* name); | 42 static bool HasEGLExtension(const char* name); |
| 40 static bool IsCreateContextRobustnessSupported(); | 43 static bool IsCreateContextRobustnessSupported(); |
| 44 static bool IsEGLSurfacelessContextSupported(); |
| 41 | 45 |
| 42 protected: | 46 protected: |
| 43 virtual ~GLSurfaceEGL(); | 47 virtual ~GLSurfaceEGL(); |
| 44 | 48 |
| 45 private: | 49 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 50 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
| 47 }; | 51 }; |
| 48 | 52 |
| 49 // Encapsulates an EGL surface bound to a view. | 53 // Encapsulates an EGL surface bound to a view. |
| 50 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 54 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 virtual ~SurfacelessEGL(); | 137 virtual ~SurfacelessEGL(); |
| 134 | 138 |
| 135 private: | 139 private: |
| 136 gfx::Size size_; | 140 gfx::Size size_; |
| 137 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 141 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 138 }; | 142 }; |
| 139 | 143 |
| 140 } // namespace gfx | 144 } // namespace gfx |
| 141 | 145 |
| 142 #endif // UI_GL_GL_SURFACE_EGL_H_ | 146 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |