| 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_FENCE_H_ | 5 #ifndef UI_GL_GL_FENCE_H_ |
| 6 #define UI_GL_GL_FENCE_H_ | 6 #define UI_GL_GL_FENCE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ui/gl/gl_export.h" | 10 #include "ui/gl/gl_export.h" |
| 11 | 11 |
| 12 namespace gfx { |
| 13 struct GpuFenceHandle; |
| 14 } |
| 15 |
| 12 namespace gl { | 16 namespace gl { |
| 13 | 17 |
| 14 class GL_EXPORT GLFence : public base::RefCounted<GLFence> { | 18 class GL_EXPORT GLFence : public base::RefCounted<GLFence> { |
| 15 public: | 19 public: |
| 16 GLFence(); | 20 GLFence(); |
| 17 | 21 |
| 18 static bool IsSupported(); | 22 static bool IsSupported(); |
| 19 static scoped_refptr<GLFence> Create(); | 23 static scoped_refptr<GLFence> Create(); |
| 24 static scoped_refptr<GLFence> CreateFromGpuFenceHandle( |
| 25 const gfx::GpuFenceHandle& handle); |
| 20 | 26 |
| 21 virtual bool HasCompleted() = 0; | 27 virtual bool HasCompleted() = 0; |
| 22 virtual void ClientWait() = 0; | 28 virtual void ClientWait() = 0; |
| 23 | 29 |
| 24 // Will block the server if supported, but might fall back to blocking the | 30 // Will block the server if supported, but might fall back to blocking the |
| 25 // client. | 31 // client. |
| 26 virtual void ServerWait() = 0; | 32 virtual void ServerWait() = 0; |
| 27 | 33 |
| 28 // Returns true if re-setting state is supported. | 34 // Returns true if re-setting state is supported. |
| 29 virtual bool ResetSupported(); | 35 virtual bool ResetSupported(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 | 51 |
| 46 private: | 52 private: |
| 47 friend class base::RefCounted<GLFence>; | 53 friend class base::RefCounted<GLFence>; |
| 48 | 54 |
| 49 DISALLOW_COPY_AND_ASSIGN(GLFence); | 55 DISALLOW_COPY_AND_ASSIGN(GLFence); |
| 50 }; | 56 }; |
| 51 | 57 |
| 52 } // namespace gl | 58 } // namespace gl |
| 53 | 59 |
| 54 #endif // UI_GL_GL_FENCE_H_ | 60 #endif // UI_GL_GL_FENCE_H_ |
| OLD | NEW |