| 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 #include "modules/webgl/WebGLSync.h" | 5 #include "modules/webgl/WebGLSync.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_interface.h" | 7 #include "gpu/command_buffer/client/gles2_interface.h" |
| 8 #include "modules/webgl/WebGL2RenderingContextBase.h" | 8 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 WebGLSync::~WebGLSync() { | |
| 13 // See the comment in WebGLObject::detachAndDeleteObject(). | |
| 14 detachAndDeleteObject(); | |
| 15 } | |
| 16 | |
| 17 WebGLSync::WebGLSync(WebGL2RenderingContextBase* ctx, | 12 WebGLSync::WebGLSync(WebGL2RenderingContextBase* ctx, |
| 18 GLsync object, | 13 GLsync object, |
| 19 GLenum objectType) | 14 GLenum objectType) |
| 20 : WebGLSharedObject(ctx), m_object(object), m_objectType(objectType) {} | 15 : WebGLSharedObject(ctx), m_object(object), m_objectType(objectType) {} |
| 21 | 16 |
| 17 WebGLSync::~WebGLSync() { |
| 18 runDestructor(); |
| 19 } |
| 20 |
| 22 void WebGLSync::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) { | 21 void WebGLSync::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) { |
| 23 gl->DeleteSync(m_object); | 22 gl->DeleteSync(m_object); |
| 24 m_object = 0; | 23 m_object = 0; |
| 25 } | 24 } |
| 26 | 25 |
| 27 } // namespace blink | 26 } // namespace blink |
| OLD | NEW |