| 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 GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ | 5 #ifndef GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ |
| 6 #define GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ | 6 #define GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <EGL/egl.h> | 8 #include <EGL/egl.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 18 | 19 |
| 19 namespace egl { | 20 namespace egl { |
| 20 | 21 |
| 21 class Config; | 22 class Config; |
| 22 class Context; | 23 class Context; |
| 23 class Surface; | 24 class Surface; |
| 24 class ThreadState; | 25 class ThreadState; |
| 25 | 26 |
| 26 class Display { | 27 class Display { |
| 27 public: | 28 public: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Context routines. | 67 // Context routines. |
| 67 EGLContext CreateContext(ThreadState*, | 68 EGLContext CreateContext(ThreadState*, |
| 68 EGLConfig, | 69 EGLConfig, |
| 69 EGLSurface share_ctx, | 70 EGLSurface share_ctx, |
| 70 const EGLint* attrib_list); | 71 const EGLint* attrib_list); |
| 71 EGLBoolean DestroyContext(ThreadState*, EGLContext); | 72 EGLBoolean DestroyContext(ThreadState*, EGLContext); |
| 72 | 73 |
| 73 EGLBoolean ReleaseCurrent(ThreadState*); | 74 EGLBoolean ReleaseCurrent(ThreadState*); |
| 74 EGLBoolean MakeCurrent(ThreadState*, EGLSurface, EGLSurface, EGLContext); | 75 EGLBoolean MakeCurrent(ThreadState*, EGLSurface, EGLSurface, EGLContext); |
| 75 | 76 |
| 77 const gpu::GpuPreferences& gpu_preferences() const { |
| 78 return gpu_preferences_; |
| 79 } |
| 76 uint64_t GenerateFenceSyncRelease(); | 80 uint64_t GenerateFenceSyncRelease(); |
| 77 bool IsFenceSyncRelease(uint64_t release); | 81 bool IsFenceSyncRelease(uint64_t release); |
| 78 bool IsFenceSyncFlushed(uint64_t release); | 82 bool IsFenceSyncFlushed(uint64_t release); |
| 79 bool IsFenceSyncFlushReceived(uint64_t release); | 83 bool IsFenceSyncFlushReceived(uint64_t release); |
| 80 | 84 |
| 81 private: | 85 private: |
| 82 void InitializeConfigsIfNeeded(); | 86 void InitializeConfigsIfNeeded(); |
| 83 const Config* GetConfig(EGLConfig); | 87 const Config* GetConfig(EGLConfig); |
| 84 Surface* GetSurface(EGLSurface); | 88 Surface* GetSurface(EGLSurface); |
| 85 Context* GetContext(EGLContext); | 89 Context* GetContext(EGLContext); |
| 86 | 90 |
| 87 base::Lock lock_; | 91 base::Lock lock_; |
| 92 gpu::GpuPreferences gpu_preferences_; |
| 88 bool is_initialized_; | 93 bool is_initialized_; |
| 89 uint64_t next_fence_sync_release_; | 94 uint64_t next_fence_sync_release_; |
| 90 std::vector<scoped_refptr<Surface>> surfaces_; | 95 std::vector<scoped_refptr<Surface>> surfaces_; |
| 91 std::vector<scoped_refptr<Context>> contexts_; | 96 std::vector<scoped_refptr<Context>> contexts_; |
| 92 scoped_ptr<Config> configs_[2]; | 97 scoped_ptr<Config> configs_[2]; |
| 93 | 98 |
| 94 DISALLOW_COPY_AND_ASSIGN(Display); | 99 DISALLOW_COPY_AND_ASSIGN(Display); |
| 95 }; | 100 }; |
| 96 | 101 |
| 97 } // namespace egl | 102 } // namespace egl |
| 98 | 103 |
| 99 #endif // GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ | 104 #endif // GPU_GLES2_CONFORM_SUPPORT_EGL_DISPLAY_H_ |
| OLD | NEW |