OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebGLSync_h | 5 #ifndef WebGLSync_h |
6 #define WebGLSync_h | 6 #define WebGLSync_h |
7 | 7 |
8 #include "modules/webgl/WebGLSharedObject.h" | 8 #include "modules/webgl/WebGLSharedObject.h" |
9 #include "public/platform/WebGraphicsContext3D.h" | |
10 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 class WebGL2RenderingContextBase; | 13 class WebGL2RenderingContextBase; |
15 | 14 |
16 class WebGLSync : public WebGLSharedObject { | 15 class WebGLSync : public WebGLSharedObject { |
17 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 17 public: |
19 ~WebGLSync() override; | 18 ~WebGLSync() override; |
20 | 19 |
21 GLsync object() const { return m_object; } | 20 GLsync object() const { return m_object; } |
22 | 21 |
23 protected: | 22 protected: |
24 WebGLSync(WebGL2RenderingContextBase*, GLsync, GLenum objectType); | 23 WebGLSync(WebGL2RenderingContextBase*, GLsync, GLenum objectType); |
25 | 24 |
26 bool hasObject() const override { return m_object != nullptr; } | 25 bool hasObject() const override { return m_object != nullptr; } |
27 void deleteObjectImpl(WebGraphicsContext3D*, gpu::gles2::GLES2Interface*) ov
erride; | 26 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override; |
28 | 27 |
29 GLenum objectType() const { return m_objectType; } | 28 GLenum objectType() const { return m_objectType; } |
30 | 29 |
31 private: | 30 private: |
32 bool isSync() const override { return true; } | 31 bool isSync() const override { return true; } |
33 | 32 |
34 GLsync m_object; | 33 GLsync m_object; |
35 GLenum m_objectType; | 34 GLenum m_objectType; |
36 }; | 35 }; |
37 | 36 |
38 } // namespace blink | 37 } // namespace blink |
39 | 38 |
40 #endif // WebGLSync_h | 39 #endif // WebGLSync_h |
OLD | NEW |