Chromium Code Reviews| Index: Source/modules/webgl/WebGLTimerQueryEXT.cpp |
| diff --git a/Source/modules/webgl/WebGLTimerQueryEXT.cpp b/Source/modules/webgl/WebGLTimerQueryEXT.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..db7fb61dd47e8675609a8d625b99a4bc6ebdc5fa |
| --- /dev/null |
| +++ b/Source/modules/webgl/WebGLTimerQueryEXT.cpp |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| + |
| +#include "modules/webgl/WebGLTimerQueryEXT.h" |
| + |
| +#include "modules/webgl/WebGLRenderingContextBase.h" |
| + |
| +namespace blink { |
| + |
| +WebGLTimerQueryEXT* WebGLTimerQueryEXT::create(WebGLRenderingContextBase* ctx) |
| +{ |
| + return new WebGLTimerQueryEXT(ctx); |
| +} |
| + |
| +WebGLTimerQueryEXT::~WebGLTimerQueryEXT() |
| +{ |
| + // See the comment in WebGLObject::detachAndDeleteObject(). |
| + detachAndDeleteObject(); |
| +} |
| + |
| +WebGLTimerQueryEXT::WebGLTimerQueryEXT(WebGLRenderingContextBase* ctx) |
| + : WebGLContextObject(ctx) |
| + , m_target(0) |
| + , m_queryId(0) |
| +{ |
| + m_queryId = context()->webContext()->createQueryEXT(); |
| +} |
| + |
| +void WebGLTimerQueryEXT::deleteObjectImpl(WebGraphicsContext3D*) |
| +{ |
| + context()->webContext()->deleteQueryEXT(m_queryId); |
|
haraken
2015/09/03 23:32:58
This looks unsafe. deleteObjectImpl() is called in
Ken Russell (switch to Gerrit)
2015/09/04 01:17:09
This is a good point and should be done, but it lo
haraken
2015/09/04 01:30:13
In conclusion, I realized that this code is safe f
David Yen
2015/09/04 16:04:41
Done.
|
| + m_queryId = 0; |
| +} |
| + |
| +} // namespace blink |