Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: Source/modules/webgl/WebGLTimerQueryEXT.cpp

Issue 1325453007: Added support for EXTDisjointTimerQuery on the Blink side. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Marked EXTDisjointTimerQuery as a draft extension, also added TODO for kbr about per frame updates Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698