| 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 <memory> | 12 #include <memory> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/weak_ptr.h" |
| 19 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 20 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 21 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 22 #include "ui/gfx/vsync_provider.h" | 24 #include "ui/gfx/vsync_provider.h" |
| 23 #include "ui/gl/gl_bindings.h" | 25 #include "ui/gl/gl_bindings.h" |
| 24 #include "ui/gl/gl_export.h" | 26 #include "ui/gl/gl_export.h" |
| 25 #include "ui/gl/gl_surface.h" | 27 #include "ui/gl/gl_surface.h" |
| 26 #include "ui/gl/gl_surface_overlay.h" | 28 #include "ui/gl/gl_surface_overlay.h" |
| 27 #include "ui/gl/sync_control_vsync_provider.h" | 29 #include "ui/gl/sync_control_vsync_provider.h" |
| 28 | 30 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void Destroy() override; | 226 void Destroy() override; |
| 225 bool IsOffscreen() override; | 227 bool IsOffscreen() override; |
| 226 bool IsSurfaceless() const override; | 228 bool IsSurfaceless() const override; |
| 227 gfx::SwapResult SwapBuffers() override; | 229 gfx::SwapResult SwapBuffers() override; |
| 228 gfx::Size GetSize() override; | 230 gfx::Size GetSize() override; |
| 229 bool Resize(const gfx::Size& size, | 231 bool Resize(const gfx::Size& size, |
| 230 float scale_factor, | 232 float scale_factor, |
| 231 bool has_alpha) override; | 233 bool has_alpha) override; |
| 232 EGLSurface GetHandle() override; | 234 EGLSurface GetHandle() override; |
| 233 void* GetShareHandle() override; | 235 void* GetShareHandle() override; |
| 236 bool SupportsInsertFence() override; |
| 237 void InsertFence(const base::Closure& callback) override; |
| 234 | 238 |
| 235 protected: | 239 protected: |
| 236 ~SurfacelessEGL() override; | 240 ~SurfacelessEGL() override; |
| 237 | 241 |
| 242 bool InsertSyncFence(const EGLint* attribs, const base::Closure& callback); |
| 243 |
| 238 private: | 244 private: |
| 245 class EGLWaitSyncFenceThread; |
| 246 |
| 247 void FenceRetired(EGLSyncKHR fence, const base::Closure& callback); |
| 248 |
| 239 gfx::Size size_; | 249 gfx::Size size_; |
| 250 scoped_refptr<EGLWaitSyncFenceThread> wait_sync_fence_thread_; |
| 251 base::WeakPtrFactory<SurfacelessEGL> weak_ptr_factory_; |
| 252 |
| 240 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 253 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 241 }; | 254 }; |
| 242 | 255 |
| 243 } // namespace gl | 256 } // namespace gl |
| 244 | 257 |
| 245 #endif // UI_GL_GL_SURFACE_EGL_H_ | 258 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |