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/WebGLTimerQueryEXT.h" | 5 #include "modules/webgl/WebGLTimerQueryEXT.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/WebGLRenderingContextBase.h" | 8 #include "modules/webgl/WebGLRenderingContextBase.h" |
9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool WebGLTimerQueryEXT::isQueryResultAvailable() | 73 bool WebGLTimerQueryEXT::isQueryResultAvailable() |
74 { | 74 { |
75 return m_queryResultAvailable; | 75 return m_queryResultAvailable; |
76 } | 76 } |
77 | 77 |
78 GLuint64 WebGLTimerQueryEXT::getQueryResult() | 78 GLuint64 WebGLTimerQueryEXT::getQueryResult() |
79 { | 79 { |
80 return m_queryResult; | 80 return m_queryResult; |
81 } | 81 } |
82 | 82 |
83 void WebGLTimerQueryEXT::deleteObjectImpl(WebGraphicsContext3D* context3d, gpu::
gles2::GLES2Interface* gl) | 83 void WebGLTimerQueryEXT::deleteObjectImpl(gpu::gles2::GLES2Interface* gl) |
84 { | 84 { |
85 gl->DeleteQueriesEXT(1, &m_queryId); | 85 gl->DeleteQueriesEXT(1, &m_queryId); |
86 m_queryId = 0; | 86 m_queryId = 0; |
87 } | 87 } |
88 | 88 |
89 void WebGLTimerQueryEXT::registerTaskObserver() | 89 void WebGLTimerQueryEXT::registerTaskObserver() |
90 { | 90 { |
91 if (!m_taskObserverRegistered) { | 91 if (!m_taskObserverRegistered) { |
92 m_taskObserverRegistered = true; | 92 m_taskObserverRegistered = true; |
93 Platform::current()->currentThread()->addTaskObserver(this); | 93 Platform::current()->currentThread()->addTaskObserver(this); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void WebGLTimerQueryEXT::unregisterTaskObserver() | 97 void WebGLTimerQueryEXT::unregisterTaskObserver() |
98 { | 98 { |
99 if (m_taskObserverRegistered) { | 99 if (m_taskObserverRegistered) { |
100 m_taskObserverRegistered = false; | 100 m_taskObserverRegistered = false; |
101 Platform::current()->currentThread()->removeTaskObserver(this); | 101 Platform::current()->currentThread()->removeTaskObserver(this); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 void WebGLTimerQueryEXT::didProcessTask() | 105 void WebGLTimerQueryEXT::didProcessTask() |
106 { | 106 { |
107 m_canUpdateAvailability = true; | 107 m_canUpdateAvailability = true; |
108 } | 108 } |
109 | 109 |
110 } // namespace blink | 110 } // namespace blink |
OLD | NEW |