| 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/WebGLQuery.h" | 5 #include "modules/webgl/WebGLQuery.h" |
| 6 | 6 |
| 7 #include "core/dom/TaskRunnerHelper.h" | 7 #include "core/dom/TaskRunnerHelper.h" |
| 8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
| 9 #include "modules/webgl/WebGL2RenderingContextBase.h" | 9 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 GLuint query; | 26 GLuint query; |
| 27 ctx->ContextGL()->GenQueriesEXT(1, &query); | 27 ctx->ContextGL()->GenQueriesEXT(1, &query); |
| 28 SetObject(query); | 28 SetObject(query); |
| 29 } | 29 } |
| 30 | 30 |
| 31 WebGLQuery::~WebGLQuery() { | 31 WebGLQuery::~WebGLQuery() { |
| 32 RunDestructor(); | 32 RunDestructor(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void WebGLQuery::SetTarget(GLenum target) { | 35 void WebGLQuery::SetTarget(GLenum target) { |
| 36 ASSERT(Object()); | 36 DCHECK(Object()); |
| 37 ASSERT(!target_); | 37 DCHECK(!target_); |
| 38 target_ = target; | 38 target_ = target; |
| 39 } | 39 } |
| 40 | 40 |
| 41 void WebGLQuery::DeleteObjectImpl(gpu::gles2::GLES2Interface* gl) { | 41 void WebGLQuery::DeleteObjectImpl(gpu::gles2::GLES2Interface* gl) { |
| 42 gl->DeleteQueriesEXT(1, &object_); | 42 gl->DeleteQueriesEXT(1, &object_); |
| 43 object_ = 0; | 43 object_ = 0; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void WebGLQuery::ResetCachedResult() { | 46 void WebGLQuery::ResetCachedResult() { |
| 47 can_update_availability_ = false; | 47 can_update_availability_ = false; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 task_handle_ = task_runner_->PostCancellableTask( | 92 task_handle_ = task_runner_->PostCancellableTask( |
| 93 BLINK_FROM_HERE, WTF::Bind(&WebGLQuery::AllowAvailabilityUpdate, | 93 BLINK_FROM_HERE, WTF::Bind(&WebGLQuery::AllowAvailabilityUpdate, |
| 94 WrapWeakPersistent(this))); | 94 WrapWeakPersistent(this))); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void WebGLQuery::AllowAvailabilityUpdate() { | 97 void WebGLQuery::AllowAvailabilityUpdate() { |
| 98 can_update_availability_ = true; | 98 can_update_availability_ = true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |