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

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

Issue 2671553003: Remove uses of VisitDOMWrapper (Closed)
Patch Set: Add DependentLifetime when removing Custom=VisitDOMWrapper Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 6277 matching lines...) Expand 10 before | Expand all | Expand 10 after
6288 gpu::gles2::GLES2Interface* gl = contextGL(); 6288 gpu::gles2::GLES2Interface* gl = contextGL();
6289 m_extensionsUtil = Extensions3DUtil::create(gl); 6289 m_extensionsUtil = Extensions3DUtil::create(gl);
6290 // The only reason the ExtensionsUtil should be invalid is if the gl context 6290 // The only reason the ExtensionsUtil should be invalid is if the gl context
6291 // is lost. 6291 // is lost.
6292 ASSERT(m_extensionsUtil->isValid() || 6292 ASSERT(m_extensionsUtil->isValid() ||
6293 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); 6293 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
6294 } 6294 }
6295 return m_extensionsUtil.get(); 6295 return m_extensionsUtil.get();
6296 } 6296 }
6297 6297
6298 void WebGLRenderingContextBase::visitChildDOMWrappers(
6299 v8::Isolate* isolate,
6300 const v8::Persistent<v8::Object>& wrapper) {
6301 if (isContextLost()) {
6302 return;
6303 }
6304 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, m_boundArrayBuffer,
6305 isolate);
6306 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6307 wrapper, m_renderbufferBinding, isolate);
6308
6309 for (auto& unit : m_textureUnits) {
6310 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6311 wrapper, unit.m_texture2DBinding, isolate);
6312 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6313 wrapper, unit.m_textureCubeMapBinding, isolate);
6314 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6315 wrapper, unit.m_texture3DBinding, isolate);
6316 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6317 wrapper, unit.m_texture2DArrayBinding, isolate);
6318 }
6319
6320 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6321 wrapper, m_framebufferBinding, isolate);
6322 if (m_framebufferBinding) {
6323 m_framebufferBinding->visitChildDOMWrappers(isolate, wrapper);
6324 }
6325
6326 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, m_currentProgram,
6327 isolate);
6328 if (m_currentProgram) {
6329 m_currentProgram->visitChildDOMWrappers(isolate, wrapper);
6330 }
6331
6332 DOMWrapperWorld::setWrapperReferencesInAllWorlds(
6333 wrapper, m_boundVertexArrayObject, isolate);
6334 if (m_boundVertexArrayObject) {
6335 m_boundVertexArrayObject->visitChildDOMWrappers(isolate, wrapper);
6336 }
6337
6338 for (ExtensionTracker* tracker : m_extensions) {
6339 WebGLExtension* extension = tracker->getExtensionObjectIfAlreadyEnabled();
6340 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, extension,
6341 isolate);
6342 }
6343 }
6344
6345 void WebGLRenderingContextBase::stop() { 6298 void WebGLRenderingContextBase::stop() {
6346 if (!isContextLost()) { 6299 if (!isContextLost()) {
6347 // Never attempt to restore the context because the page is being torn down. 6300 // Never attempt to restore the context because the page is being torn down.
6348 forceLostContext(SyntheticLostContext, Manual); 6301 forceLostContext(SyntheticLostContext, Manual);
6349 } 6302 }
6350 } 6303 }
6351 6304
6352 bool WebGLRenderingContextBase::DrawingBufferClientIsBoundForDraw() { 6305 bool WebGLRenderingContextBase::DrawingBufferClientIsBoundForDraw() {
6353 return !m_framebufferBinding; 6306 return !m_framebufferBinding;
6354 } 6307 }
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
7838 7791
7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7792 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7840 HTMLCanvasElementOrOffscreenCanvas& result) const { 7793 HTMLCanvasElementOrOffscreenCanvas& result) const {
7841 if (canvas()) 7794 if (canvas())
7842 result.setHTMLCanvasElement(canvas()); 7795 result.setHTMLCanvasElement(canvas());
7843 else 7796 else
7844 result.setOffscreenCanvas(offscreenCanvas()); 7797 result.setOffscreenCanvas(offscreenCanvas());
7845 } 7798 }
7846 7799
7847 } // namespace blink 7800 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698