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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2437233002: Implement EXT_disjoint_timer_query_webgl2 (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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/WebGL2RenderingContextBase.h" 5 #include "modules/webgl/WebGL2RenderingContextBase.h"
6 6
7 #include "bindings/modules/v8/WebGLAny.h" 7 #include "bindings/modules/v8/WebGLAny.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/frame/ImageBitmap.h" 9 #include "core/frame/ImageBitmap.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 2), 230 2),
231 m_readFramebufferBinding(this, nullptr), 231 m_readFramebufferBinding(this, nullptr),
232 m_transformFeedbackBinding(this, nullptr), 232 m_transformFeedbackBinding(this, nullptr),
233 m_boundCopyReadBuffer(this, nullptr), 233 m_boundCopyReadBuffer(this, nullptr),
234 m_boundCopyWriteBuffer(this, nullptr), 234 m_boundCopyWriteBuffer(this, nullptr),
235 m_boundPixelPackBuffer(this, nullptr), 235 m_boundPixelPackBuffer(this, nullptr),
236 m_boundPixelUnpackBuffer(this, nullptr), 236 m_boundPixelUnpackBuffer(this, nullptr),
237 m_boundTransformFeedbackBuffer(this, nullptr), 237 m_boundTransformFeedbackBuffer(this, nullptr),
238 m_boundUniformBuffer(this, nullptr), 238 m_boundUniformBuffer(this, nullptr),
239 m_currentBooleanOcclusionQuery(this, nullptr), 239 m_currentBooleanOcclusionQuery(this, nullptr),
240 m_currentTransformFeedbackPrimitivesWrittenQuery(this, nullptr) { 240 m_currentTransformFeedbackPrimitivesWrittenQuery(this, nullptr),
241 m_currentElapsedQuery(this, nullptr) {
241 m_supportedInternalFormatsStorage.insert( 242 m_supportedInternalFormatsStorage.insert(
242 kSupportedInternalFormatsStorage, 243 kSupportedInternalFormatsStorage,
243 kSupportedInternalFormatsStorage + 244 kSupportedInternalFormatsStorage +
244 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage)); 245 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage));
245 } 246 }
246 247
247 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() { 248 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() {
248 m_readFramebufferBinding = nullptr; 249 m_readFramebufferBinding = nullptr;
249 250
250 m_boundCopyReadBuffer = nullptr; 251 m_boundCopyReadBuffer = nullptr;
251 m_boundCopyWriteBuffer = nullptr; 252 m_boundCopyWriteBuffer = nullptr;
252 m_boundPixelPackBuffer = nullptr; 253 m_boundPixelPackBuffer = nullptr;
253 m_boundPixelUnpackBuffer = nullptr; 254 m_boundPixelUnpackBuffer = nullptr;
254 m_boundTransformFeedbackBuffer = nullptr; 255 m_boundTransformFeedbackBuffer = nullptr;
255 m_boundUniformBuffer = nullptr; 256 m_boundUniformBuffer = nullptr;
256 257
257 m_currentBooleanOcclusionQuery = nullptr; 258 m_currentBooleanOcclusionQuery = nullptr;
258 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; 259 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr;
260 m_currentElapsedQuery = nullptr;
259 } 261 }
260 262
261 void WebGL2RenderingContextBase::destroyContext() { 263 void WebGL2RenderingContextBase::destroyContext() {
262 for (auto& callback : m_getBufferSubDataAsyncCallbacks) { 264 for (auto& callback : m_getBufferSubDataAsyncCallbacks) {
263 callback->destroy(); 265 callback->destroy();
264 } 266 }
265 m_getBufferSubDataAsyncCallbacks.clear(); 267 m_getBufferSubDataAsyncCallbacks.clear();
266 268
267 WebGLRenderingContextBase::destroyContext(); 269 WebGLRenderingContextBase::destroyContext();
268 } 270 }
269 271
270 void WebGL2RenderingContextBase::initializeNewContext() { 272 void WebGL2RenderingContextBase::initializeNewContext() {
271 ASSERT(!isContextLost()); 273 ASSERT(!isContextLost());
272 ASSERT(drawingBuffer()); 274 ASSERT(drawingBuffer());
273 275
274 m_readFramebufferBinding = nullptr; 276 m_readFramebufferBinding = nullptr;
275 277
276 m_boundCopyReadBuffer = nullptr; 278 m_boundCopyReadBuffer = nullptr;
277 m_boundCopyWriteBuffer = nullptr; 279 m_boundCopyWriteBuffer = nullptr;
278 m_boundPixelPackBuffer = nullptr; 280 m_boundPixelPackBuffer = nullptr;
279 m_boundPixelUnpackBuffer = nullptr; 281 m_boundPixelUnpackBuffer = nullptr;
280 m_boundTransformFeedbackBuffer = nullptr; 282 m_boundTransformFeedbackBuffer = nullptr;
281 m_boundUniformBuffer = nullptr; 283 m_boundUniformBuffer = nullptr;
282 284
283 m_currentBooleanOcclusionQuery = nullptr; 285 m_currentBooleanOcclusionQuery = nullptr;
284 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; 286 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr;
287 m_currentElapsedQuery = nullptr;
285 288
286 GLint numCombinedTextureImageUnits = 0; 289 GLint numCombinedTextureImageUnits = 0;
287 contextGL()->GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 290 contextGL()->GetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
288 &numCombinedTextureImageUnits); 291 &numCombinedTextureImageUnits);
289 m_samplerUnits.clear(); 292 m_samplerUnits.clear();
290 m_samplerUnits.resize(numCombinedTextureImageUnits); 293 m_samplerUnits.resize(numCombinedTextureImageUnits);
291 294
292 m_maxTransformFeedbackSeparateAttribs = 0; 295 m_maxTransformFeedbackSeparateAttribs = 0;
293 contextGL()->GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 296 contextGL()->GetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
294 &m_maxTransformFeedbackSeparateAttribs); 297 &m_maxTransformFeedbackSeparateAttribs);
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 if (m_currentBooleanOcclusionQuery == query) { 2637 if (m_currentBooleanOcclusionQuery == query) {
2635 contextGL()->EndQueryEXT(m_currentBooleanOcclusionQuery->getTarget()); 2638 contextGL()->EndQueryEXT(m_currentBooleanOcclusionQuery->getTarget());
2636 m_currentBooleanOcclusionQuery = nullptr; 2639 m_currentBooleanOcclusionQuery = nullptr;
2637 } 2640 }
2638 2641
2639 if (m_currentTransformFeedbackPrimitivesWrittenQuery == query) { 2642 if (m_currentTransformFeedbackPrimitivesWrittenQuery == query) {
2640 contextGL()->EndQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); 2643 contextGL()->EndQueryEXT(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
2641 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; 2644 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr;
2642 } 2645 }
2643 2646
2647 if (m_currentElapsedQuery == query) {
2648 contextGL()->EndQueryEXT(m_currentElapsedQuery->getTarget());
2649 m_currentElapsedQuery = nullptr;
2650 }
2651
2644 deleteObject(query); 2652 deleteObject(query);
2645 } 2653 }
2646 2654
2647 GLboolean WebGL2RenderingContextBase::isQuery(WebGLQuery* query) { 2655 GLboolean WebGL2RenderingContextBase::isQuery(WebGLQuery* query) {
2648 if (isContextLost() || !query) 2656 if (isContextLost() || !query)
2649 return 0; 2657 return 0;
2650 2658
2651 return contextGL()->IsQueryEXT(query->object()); 2659 return contextGL()->IsQueryEXT(query->object());
2652 } 2660 }
2653 2661
(...skipping 30 matching lines...) Expand all
2684 m_currentBooleanOcclusionQuery = query; 2692 m_currentBooleanOcclusionQuery = query;
2685 } break; 2693 } break;
2686 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: { 2694 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: {
2687 if (m_currentTransformFeedbackPrimitivesWrittenQuery) { 2695 if (m_currentTransformFeedbackPrimitivesWrittenQuery) {
2688 synthesizeGLError(GL_INVALID_OPERATION, "beginQuery", 2696 synthesizeGLError(GL_INVALID_OPERATION, "beginQuery",
2689 "a query is already active for target"); 2697 "a query is already active for target");
2690 return; 2698 return;
2691 } 2699 }
2692 m_currentTransformFeedbackPrimitivesWrittenQuery = query; 2700 m_currentTransformFeedbackPrimitivesWrittenQuery = query;
2693 } break; 2701 } break;
2702 case GL_TIME_ELAPSED_EXT: {
2703 if (!extensionEnabled(EXTDisjointTimerQueryWebGL2Name)) {
2704 synthesizeGLError(GL_INVALID_ENUM, "beginQuery", "invalid target");
2705 return;
2706 }
2707 if (m_currentElapsedQuery) {
2708 synthesizeGLError(GL_INVALID_OPERATION, "beginQuery",
2709 "a query is already active for target");
2710 return;
2711 }
2712 m_currentElapsedQuery = query;
2713 } break;
2694 default: 2714 default:
2695 synthesizeGLError(GL_INVALID_ENUM, "beginQuery", "invalid target"); 2715 synthesizeGLError(GL_INVALID_ENUM, "beginQuery", "invalid target");
2696 return; 2716 return;
2697 } 2717 }
2698 2718
2699 if (!query->getTarget()) 2719 if (!query->getTarget())
2700 query->setTarget(target); 2720 query->setTarget(target);
2701 2721
2702 contextGL()->BeginQueryEXT(target, query->object()); 2722 contextGL()->BeginQueryEXT(target, query->object());
2703 } 2723 }
(...skipping 18 matching lines...) Expand all
2722 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: { 2742 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: {
2723 if (m_currentTransformFeedbackPrimitivesWrittenQuery) { 2743 if (m_currentTransformFeedbackPrimitivesWrittenQuery) {
2724 m_currentTransformFeedbackPrimitivesWrittenQuery->resetCachedResult(); 2744 m_currentTransformFeedbackPrimitivesWrittenQuery->resetCachedResult();
2725 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr; 2745 m_currentTransformFeedbackPrimitivesWrittenQuery = nullptr;
2726 } else { 2746 } else {
2727 synthesizeGLError(GL_INVALID_OPERATION, "endQuery", 2747 synthesizeGLError(GL_INVALID_OPERATION, "endQuery",
2728 "target query is not active"); 2748 "target query is not active");
2729 return; 2749 return;
2730 } 2750 }
2731 } break; 2751 } break;
2752 case GL_TIME_ELAPSED_EXT: {
2753 if (!extensionEnabled(EXTDisjointTimerQueryWebGL2Name)) {
2754 synthesizeGLError(GL_INVALID_ENUM, "endQuery", "invalid target");
2755 return;
2756 }
2757 if (m_currentElapsedQuery) {
2758 m_currentElapsedQuery->resetCachedResult();
2759 m_currentElapsedQuery = nullptr;
2760 } else {
2761 synthesizeGLError(GL_INVALID_OPERATION, "endQuery",
2762 "target query is not active");
2763 return;
2764 }
2765 } break;
2732 default: 2766 default:
2733 synthesizeGLError(GL_INVALID_ENUM, "endQuery", "invalid target"); 2767 synthesizeGLError(GL_INVALID_ENUM, "endQuery", "invalid target");
2734 return; 2768 return;
2735 } 2769 }
2736 2770
2737 contextGL()->EndQueryEXT(target); 2771 contextGL()->EndQueryEXT(target);
2738 } 2772 }
2739 2773
2740 WebGLQuery* WebGL2RenderingContextBase::getQuery(GLenum target, GLenum pname) { 2774 ScriptValue WebGL2RenderingContextBase::getQuery(ScriptState* scriptState,
2775 GLenum target,
2776 GLenum pname) {
2741 if (isContextLost()) 2777 if (isContextLost())
2742 return nullptr; 2778 return ScriptValue::createNull(scriptState);
2779
2780 if (extensionEnabled(EXTDisjointTimerQueryWebGL2Name)) {
2781 switch (target) {
2782 case GL_TIME_ELAPSED_EXT:
2783 if (pname == GL_CURRENT_QUERY && m_currentElapsedQuery.get()) {
2784 return WebGLAny(scriptState, m_currentElapsedQuery.get());
2785 }
2786 return ScriptValue::createNull(scriptState);
2787 case GL_TIMESTAMP_EXT:
2788 if (pname == GL_QUERY_COUNTER_BITS_EXT) {
2789 GLint value = 0;
2790 contextGL()->GetQueryivEXT(target, pname, &value);
2791 return WebGLAny(scriptState, value);
2792 }
2793 return ScriptValue::createNull(scriptState);
2794 }
2795 }
2743 2796
2744 if (pname != GL_CURRENT_QUERY) { 2797 if (pname != GL_CURRENT_QUERY) {
2745 synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid parameter name"); 2798 synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid parameter name");
2746 return nullptr; 2799 return ScriptValue::createNull(scriptState);
2747 } 2800 }
2748 2801
2749 switch (target) { 2802 switch (target) {
2750 case GL_ANY_SAMPLES_PASSED: 2803 case GL_ANY_SAMPLES_PASSED:
2751 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: 2804 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
2752 if (m_currentBooleanOcclusionQuery && 2805 if (m_currentBooleanOcclusionQuery &&
2753 m_currentBooleanOcclusionQuery->getTarget() == target) 2806 m_currentBooleanOcclusionQuery->getTarget() == target)
2754 return m_currentBooleanOcclusionQuery; 2807 return WebGLAny(scriptState, m_currentBooleanOcclusionQuery);
2755 break; 2808 break;
2756 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 2809 case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
2757 return m_currentTransformFeedbackPrimitivesWrittenQuery; 2810 return WebGLAny(scriptState,
2811 m_currentTransformFeedbackPrimitivesWrittenQuery);
2758 default: 2812 default:
2759 synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid target"); 2813 synthesizeGLError(GL_INVALID_ENUM, "getQuery", "invalid target");
2760 return nullptr; 2814 return ScriptValue::createNull(scriptState);
2761 } 2815 }
2762 return nullptr; 2816 return ScriptValue::createNull(scriptState);
2763 } 2817 }
2764 2818
2765 ScriptValue WebGL2RenderingContextBase::getQueryParameter( 2819 ScriptValue WebGL2RenderingContextBase::getQueryParameter(
2766 ScriptState* scriptState, 2820 ScriptState* scriptState,
2767 WebGLQuery* query, 2821 WebGLQuery* query,
2768 GLenum pname) { 2822 GLenum pname) {
2769 bool deleted; 2823 bool deleted;
2770 if (!query) { 2824 if (!query) {
2771 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", 2825 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter",
2772 "query object is null"); 2826 "query object is null");
2773 return ScriptValue::createNull(scriptState); 2827 return ScriptValue::createNull(scriptState);
2774 } 2828 }
2775 if (!checkObjectToBeBound("getQueryParameter", query, deleted)) 2829 if (!checkObjectToBeBound("getQueryParameter", query, deleted))
2776 return ScriptValue::createNull(scriptState); 2830 return ScriptValue::createNull(scriptState);
2777 if (deleted) { 2831 if (deleted) {
2778 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", 2832 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter",
2779 "attempted to access to a deleted query object"); 2833 "attempted to access to a deleted query object");
2780 return ScriptValue::createNull(scriptState); 2834 return ScriptValue::createNull(scriptState);
2781 } 2835 }
2782 2836
2783 // Query is non-null at this point. 2837 // Query is non-null at this point.
2784 if (!query->getTarget()) { 2838 if (!query->getTarget()) {
2785 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", 2839 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter",
2786 "'query' is not a query object yet, since it has't been " 2840 "'query' is not a query object yet, since it has't been "
2787 "used by beginQuery"); 2841 "used by beginQuery");
2788 return ScriptValue::createNull(scriptState); 2842 return ScriptValue::createNull(scriptState);
2789 } 2843 }
2790 if (query == m_currentBooleanOcclusionQuery || 2844 if (query == m_currentBooleanOcclusionQuery ||
2791 query == m_currentTransformFeedbackPrimitivesWrittenQuery) { 2845 query == m_currentTransformFeedbackPrimitivesWrittenQuery ||
2846 query == m_currentElapsedQuery) {
2792 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter", 2847 synthesizeGLError(GL_INVALID_OPERATION, "getQueryParameter",
2793 "query is currently active"); 2848 "query is currently active");
2794 return ScriptValue::createNull(scriptState); 2849 return ScriptValue::createNull(scriptState);
2795 } 2850 }
2796 2851
2797 switch (pname) { 2852 switch (pname) {
2798 case GL_QUERY_RESULT: { 2853 case GL_QUERY_RESULT: {
2799 query->updateCachedResult(contextGL()); 2854 query->updateCachedResult(contextGL());
2800 return WebGLAny(scriptState, query->getQueryResult()); 2855 return WebGLAny(scriptState, query->getQueryResult());
2801 } 2856 }
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
3832 case GL_UNPACK_IMAGE_HEIGHT: 3887 case GL_UNPACK_IMAGE_HEIGHT:
3833 return getIntParameter(scriptState, pname); 3888 return getIntParameter(scriptState, pname);
3834 case GL_UNPACK_ROW_LENGTH: 3889 case GL_UNPACK_ROW_LENGTH:
3835 return getIntParameter(scriptState, pname); 3890 return getIntParameter(scriptState, pname);
3836 case GL_UNPACK_SKIP_IMAGES: 3891 case GL_UNPACK_SKIP_IMAGES:
3837 return getIntParameter(scriptState, pname); 3892 return getIntParameter(scriptState, pname);
3838 case GL_UNPACK_SKIP_PIXELS: 3893 case GL_UNPACK_SKIP_PIXELS:
3839 return getIntParameter(scriptState, pname); 3894 return getIntParameter(scriptState, pname);
3840 case GL_UNPACK_SKIP_ROWS: 3895 case GL_UNPACK_SKIP_ROWS:
3841 return getIntParameter(scriptState, pname); 3896 return getIntParameter(scriptState, pname);
3897 case GL_TIMESTAMP_EXT:
3898 if (extensionEnabled(EXTDisjointTimerQueryWebGL2Name)) {
3899 return WebGLAny(scriptState, 0);
3900 }
3901 synthesizeGLError(GL_INVALID_ENUM, "getParameter",
3902 "invalid parameter name, "
3903 "EXT_disjoint_timer_query_webgl2 not enabled");
3904 return ScriptValue::createNull(scriptState);
Ken Russell (switch to Gerrit) 2016/10/21 00:18:13 I'm not sure this is the same thing as returning t
Kai Ninomiya 2016/10/21 17:58:10 This is the case where the given pname (GL_TIMESTA
Ken Russell (switch to Gerrit) 2016/10/21 20:53:14 OK, I see. Thanks. I have a related concern which
3905 case GL_GPU_DISJOINT_EXT:
3906 if (extensionEnabled(EXTDisjointTimerQueryWebGL2Name)) {
3907 return getBooleanParameter(scriptState, GL_GPU_DISJOINT_EXT);
3908 }
3909 synthesizeGLError(GL_INVALID_ENUM, "getParameter",
3910 "invalid parameter name, "
3911 "EXT_disjoint_timer_query_webgl2 not enabled");
3912 return ScriptValue::createNull(scriptState);
Ken Russell (switch to Gerrit) 2016/10/21 00:18:13 Same here -- this needs to explicitly return a boo
Kai Ninomiya 2016/10/21 17:58:10 See above.
3842 3913
3843 default: 3914 default:
3844 return WebGLRenderingContextBase::getParameter(scriptState, pname); 3915 return WebGLRenderingContextBase::getParameter(scriptState, pname);
3845 } 3916 }
3846 } 3917 }
3847 3918
3848 ScriptValue WebGL2RenderingContextBase::getInt64Parameter( 3919 ScriptValue WebGL2RenderingContextBase::getInt64Parameter(
3849 ScriptState* scriptState, 3920 ScriptState* scriptState,
3850 GLenum pname) { 3921 GLenum pname) {
3851 GLint64 value = 0; 3922 GLint64 value = 0;
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
4407 visitor->trace(m_boundCopyReadBuffer); 4478 visitor->trace(m_boundCopyReadBuffer);
4408 visitor->trace(m_boundCopyWriteBuffer); 4479 visitor->trace(m_boundCopyWriteBuffer);
4409 visitor->trace(m_boundPixelPackBuffer); 4480 visitor->trace(m_boundPixelPackBuffer);
4410 visitor->trace(m_boundPixelUnpackBuffer); 4481 visitor->trace(m_boundPixelUnpackBuffer);
4411 visitor->trace(m_boundTransformFeedbackBuffer); 4482 visitor->trace(m_boundTransformFeedbackBuffer);
4412 visitor->trace(m_boundUniformBuffer); 4483 visitor->trace(m_boundUniformBuffer);
4413 visitor->trace(m_boundIndexedTransformFeedbackBuffers); 4484 visitor->trace(m_boundIndexedTransformFeedbackBuffers);
4414 visitor->trace(m_boundIndexedUniformBuffers); 4485 visitor->trace(m_boundIndexedUniformBuffers);
4415 visitor->trace(m_currentBooleanOcclusionQuery); 4486 visitor->trace(m_currentBooleanOcclusionQuery);
4416 visitor->trace(m_currentTransformFeedbackPrimitivesWrittenQuery); 4487 visitor->trace(m_currentTransformFeedbackPrimitivesWrittenQuery);
4488 visitor->trace(m_currentElapsedQuery);
4417 visitor->trace(m_samplerUnits); 4489 visitor->trace(m_samplerUnits);
4418 visitor->trace(m_getBufferSubDataAsyncCallbacks); 4490 visitor->trace(m_getBufferSubDataAsyncCallbacks);
4419 WebGLRenderingContextBase::trace(visitor); 4491 WebGLRenderingContextBase::trace(visitor);
4420 } 4492 }
4421 4493
4422 DEFINE_TRACE_WRAPPERS(WebGL2RenderingContextBase) { 4494 DEFINE_TRACE_WRAPPERS(WebGL2RenderingContextBase) {
4423 if (isContextLost()) { 4495 if (isContextLost()) {
4424 return; 4496 return;
4425 } 4497 }
4426 4498
4427 visitor->traceWrappers(m_transformFeedbackBinding); 4499 visitor->traceWrappers(m_transformFeedbackBinding);
4428 visitor->traceWrappers(m_readFramebufferBinding); 4500 visitor->traceWrappers(m_readFramebufferBinding);
4429 visitor->traceWrappers(m_boundCopyReadBuffer); 4501 visitor->traceWrappers(m_boundCopyReadBuffer);
4430 visitor->traceWrappers(m_boundCopyWriteBuffer); 4502 visitor->traceWrappers(m_boundCopyWriteBuffer);
4431 visitor->traceWrappers(m_boundPixelPackBuffer); 4503 visitor->traceWrappers(m_boundPixelPackBuffer);
4432 visitor->traceWrappers(m_boundPixelUnpackBuffer); 4504 visitor->traceWrappers(m_boundPixelUnpackBuffer);
4433 visitor->traceWrappers(m_boundTransformFeedbackBuffer); 4505 visitor->traceWrappers(m_boundTransformFeedbackBuffer);
4434 visitor->traceWrappers(m_boundUniformBuffer); 4506 visitor->traceWrappers(m_boundUniformBuffer);
4435 for (auto& buf : m_boundIndexedTransformFeedbackBuffers) { 4507 for (auto& buf : m_boundIndexedTransformFeedbackBuffers) {
4436 visitor->traceWrappers(buf); 4508 visitor->traceWrappers(buf);
4437 } 4509 }
4438 for (auto& buf : m_boundIndexedUniformBuffers) { 4510 for (auto& buf : m_boundIndexedUniformBuffers) {
4439 visitor->traceWrappers(buf); 4511 visitor->traceWrappers(buf);
4440 } 4512 }
4441 visitor->traceWrappers(m_currentBooleanOcclusionQuery); 4513 visitor->traceWrappers(m_currentBooleanOcclusionQuery);
4442 visitor->traceWrappers(m_currentTransformFeedbackPrimitivesWrittenQuery); 4514 visitor->traceWrappers(m_currentTransformFeedbackPrimitivesWrittenQuery);
4515 visitor->traceWrappers(m_currentElapsedQuery);
4443 for (auto& unit : m_samplerUnits) { 4516 for (auto& unit : m_samplerUnits) {
4444 visitor->traceWrappers(unit); 4517 visitor->traceWrappers(unit);
4445 } 4518 }
4446 WebGLRenderingContextBase::traceWrappers(visitor); 4519 WebGLRenderingContextBase::traceWrappers(visitor);
4447 } 4520 }
4448 4521
4449 WebGLTexture* WebGL2RenderingContextBase::validateTexture3DBinding( 4522 WebGLTexture* WebGL2RenderingContextBase::validateTexture3DBinding(
4450 const char* functionName, 4523 const char* functionName,
4451 GLenum target) { 4524 GLenum target) {
4452 WebGLTexture* tex = nullptr; 4525 WebGLTexture* tex = nullptr;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 } 4758 }
4686 4759
4687 for (auto& buf : m_boundIndexedUniformBuffers) { 4760 for (auto& buf : m_boundIndexedUniformBuffers) {
4688 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, buf, isolate); 4761 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, buf, isolate);
4689 } 4762 }
4690 4763
4691 DOMWrapperWorld::setWrapperReferencesInAllWorlds( 4764 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
4692 wrapper, m_currentBooleanOcclusionQuery, isolate); 4765 wrapper, m_currentBooleanOcclusionQuery, isolate);
4693 DOMWrapperWorld::setWrapperReferencesInAllWorlds( 4766 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
4694 wrapper, m_currentTransformFeedbackPrimitivesWrittenQuery, isolate); 4767 wrapper, m_currentTransformFeedbackPrimitivesWrittenQuery, isolate);
4768 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
4769 wrapper, m_currentElapsedQuery, isolate);
4695 4770
4696 for (auto& unit : m_samplerUnits) { 4771 for (auto& unit : m_samplerUnits) {
4697 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, unit, isolate); 4772 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, unit, isolate);
4698 } 4773 }
4699 } 4774 }
4700 4775
4701 WebGLImageConversion::PixelStoreParams 4776 WebGLImageConversion::PixelStoreParams
4702 WebGL2RenderingContextBase::getPackPixelStoreParams() { 4777 WebGL2RenderingContextBase::getPackPixelStoreParams() {
4703 WebGLImageConversion::PixelStoreParams params; 4778 WebGLImageConversion::PixelStoreParams params;
4704 params.alignment = m_packAlignment; 4779 params.alignment = m_packAlignment;
(...skipping 12 matching lines...) Expand all
4717 params.skipPixels = m_unpackSkipPixels; 4792 params.skipPixels = m_unpackSkipPixels;
4718 params.skipRows = m_unpackSkipRows; 4793 params.skipRows = m_unpackSkipRows;
4719 if (dimension == Tex3D) { 4794 if (dimension == Tex3D) {
4720 params.imageHeight = m_unpackImageHeight; 4795 params.imageHeight = m_unpackImageHeight;
4721 params.skipImages = m_unpackSkipImages; 4796 params.skipImages = m_unpackSkipImages;
4722 } 4797 }
4723 return params; 4798 return params;
4724 } 4799 }
4725 4800
4726 } // namespace blink 4801 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698