Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 case GL_FRAGMENT_SHADER: | 140 case GL_FRAGMENT_SHADER: |
| 141 if (m_fragmentShader != shader) | 141 if (m_fragmentShader != shader) |
| 142 return false; | 142 return false; |
| 143 m_fragmentShader = nullptr; | 143 m_fragmentShader = nullptr; |
| 144 return true; | 144 return true; |
| 145 default: | 145 default: |
| 146 return false; | 146 return false; |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 ScopedPersistent<v8::Array>* WebGLProgram::getPersistentCache() | 150 void WebGLProgram::visitChildDOMWrappers(v8::Isolate* isolate, const v8::Persist ent<v8::Object>& wrapper) |
| 151 { | 151 { |
| 152 return &m_shaderWrappers; | 152 trySetWrapperReferencesInAllWorlds(wrapper, this, isolate); |
|
Ken Russell (switch to Gerrit)
2016/09/01 21:03:53
Same here.
Kai Ninomiya
2016/09/02 18:29:22
Done.
| |
| 153 trySetWrapperReferencesInAllWorlds(wrapper, m_vertexShader, isolate); | |
| 154 trySetWrapperReferencesInAllWorlds(wrapper, m_fragmentShader, isolate); | |
| 153 } | 155 } |
| 154 | 156 |
| 155 void WebGLProgram::cacheInfoIfNeeded(WebGLRenderingContextBase* context) | 157 void WebGLProgram::cacheInfoIfNeeded(WebGLRenderingContextBase* context) |
| 156 { | 158 { |
| 157 if (m_infoValid) | 159 if (m_infoValid) |
| 158 return; | 160 return; |
| 159 if (!m_object) | 161 if (!m_object) |
| 160 return; | 162 return; |
| 161 gpu::gles2::GLES2Interface* gl = context->contextGL(); | 163 gpu::gles2::GLES2Interface* gl = context->contextGL(); |
| 162 m_linkStatus = 0; | 164 m_linkStatus = 0; |
| 163 gl->GetProgramiv(m_object, GL_LINK_STATUS, &m_linkStatus); | 165 gl->GetProgramiv(m_object, GL_LINK_STATUS, &m_linkStatus); |
| 164 m_infoValid = true; | 166 m_infoValid = true; |
| 165 } | 167 } |
| 166 | 168 |
| 167 DEFINE_TRACE(WebGLProgram) | 169 DEFINE_TRACE(WebGLProgram) |
| 168 { | 170 { |
| 169 visitor->trace(m_vertexShader); | 171 visitor->trace(m_vertexShader); |
| 170 visitor->trace(m_fragmentShader); | 172 visitor->trace(m_fragmentShader); |
| 171 WebGLSharedPlatform3DObject::trace(visitor); | 173 WebGLSharedPlatform3DObject::trace(visitor); |
| 172 } | 174 } |
| 173 | 175 |
| 174 } // namespace blink | 176 } // namespace blink |
| OLD | NEW |