| 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/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/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.h" | 
| 9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" | 
| 10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" | 
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1375 void WebGL2RenderingContextBase::drawElementsInstanced(GLenum mode, GLsizei coun
      t, GLenum type, long long offset, GLsizei instanceCount) | 1375 void WebGL2RenderingContextBase::drawElementsInstanced(GLenum mode, GLsizei coun
      t, GLenum type, long long offset, GLsizei instanceCount) | 
| 1376 { | 1376 { | 
| 1377     if (!validateDrawElements("drawElementsInstanced", type, offset)) | 1377     if (!validateDrawElements("drawElementsInstanced", type, offset)) | 
| 1378         return; | 1378         return; | 
| 1379 | 1379 | 
| 1380     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 1380     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 
| 1381         synthesizeGLError(GL_INVALID_OPERATION, "drawElementsInstanced", "no buf
      fer is bound to enabled attribute"); | 1381         synthesizeGLError(GL_INVALID_OPERATION, "drawElementsInstanced", "no buf
      fer is bound to enabled attribute"); | 
| 1382         return; | 1382         return; | 
| 1383     } | 1383     } | 
| 1384 | 1384 | 
| 1385     if (transformFeedbackActive() && !transformFeedbackPaused()) { |  | 
| 1386         synthesizeGLError(GL_INVALID_OPERATION, "drawElementsInstanced", "transf
      orm feedback is active and not paused"); |  | 
| 1387         return; |  | 
| 1388     } |  | 
| 1389 |  | 
| 1390     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 1385     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 
| 1391     clearIfComposited(); | 1386     clearIfComposited(); | 
| 1392     contextGL()->DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<
      void*>(static_cast<intptr_t>(offset)), instanceCount); | 1387     contextGL()->DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<
      void*>(static_cast<intptr_t>(offset)), instanceCount); | 
| 1393     markContextChanged(CanvasChanged); | 1388     markContextChanged(CanvasChanged); | 
| 1394 } | 1389 } | 
| 1395 | 1390 | 
| 1396 void WebGL2RenderingContextBase::drawRangeElements(GLenum mode, GLuint start, GL
      uint end, GLsizei count, GLenum type, long long offset) | 1391 void WebGL2RenderingContextBase::drawRangeElements(GLenum mode, GLuint start, GL
      uint end, GLsizei count, GLenum type, long long offset) | 
| 1397 { | 1392 { | 
| 1398     if (!validateDrawElements("drawRangeElements", type, offset)) | 1393     if (!validateDrawElements("drawRangeElements", type, offset)) | 
| 1399         return; | 1394         return; | 
| 1400 | 1395 | 
| 1401     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 1396     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 
| 1402         synthesizeGLError(GL_INVALID_OPERATION, "drawRangeElements", "no buffer 
      is bound to enabled attribute"); | 1397         synthesizeGLError(GL_INVALID_OPERATION, "drawRangeElements", "no buffer 
      is bound to enabled attribute"); | 
| 1403         return; | 1398         return; | 
| 1404     } | 1399     } | 
| 1405 | 1400 | 
| 1406     if (transformFeedbackActive() && !transformFeedbackPaused()) { |  | 
| 1407         synthesizeGLError(GL_INVALID_OPERATION, "drawRangeElements", "transform 
      feedback is active and not paused"); |  | 
| 1408         return; |  | 
| 1409     } |  | 
| 1410 |  | 
| 1411     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 1401     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 
| 1412     clearIfComposited(); | 1402     clearIfComposited(); | 
| 1413     contextGL()->DrawRangeElements(mode, start, end, count, type, reinterpret_ca
      st<void*>(static_cast<intptr_t>(offset))); | 1403     contextGL()->DrawRangeElements(mode, start, end, count, type, reinterpret_ca
      st<void*>(static_cast<intptr_t>(offset))); | 
| 1414     markContextChanged(CanvasChanged); | 1404     markContextChanged(CanvasChanged); | 
| 1415 } | 1405 } | 
| 1416 | 1406 | 
| 1417 void WebGL2RenderingContextBase::drawBuffers(const Vector<GLenum>& buffers) | 1407 void WebGL2RenderingContextBase::drawBuffers(const Vector<GLenum>& buffers) | 
| 1418 { | 1408 { | 
| 1419     if (isContextLost()) | 1409     if (isContextLost()) | 
| 1420         return; | 1410         return; | 
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2000 { | 1990 { | 
| 2001     if (isContextLost()) | 1991     if (isContextLost()) | 
| 2002         return nullptr; | 1992         return nullptr; | 
| 2003     WebGLTransformFeedback* o = WebGLTransformFeedback::create(this); | 1993     WebGLTransformFeedback* o = WebGLTransformFeedback::create(this); | 
| 2004     addSharedObject(o); | 1994     addSharedObject(o); | 
| 2005     return o; | 1995     return o; | 
| 2006 } | 1996 } | 
| 2007 | 1997 | 
| 2008 void WebGL2RenderingContextBase::deleteTransformFeedback(WebGLTransformFeedback*
       feedback) | 1998 void WebGL2RenderingContextBase::deleteTransformFeedback(WebGLTransformFeedback*
       feedback) | 
| 2009 { | 1999 { | 
| 2010     if (transformFeedbackActive()) { |  | 
| 2011         synthesizeGLError(GL_INVALID_OPERATION, "deleteTransformFeedback", "tran
      sform feedback is active"); |  | 
| 2012         return; |  | 
| 2013     } |  | 
| 2014     if (feedback == m_transformFeedbackBinding) | 2000     if (feedback == m_transformFeedbackBinding) | 
| 2015         m_transformFeedbackBinding = nullptr; | 2001         m_transformFeedbackBinding = nullptr; | 
| 2016 | 2002 | 
| 2017     deleteObject(feedback); | 2003     deleteObject(feedback); | 
| 2018 } | 2004 } | 
| 2019 | 2005 | 
| 2020 GLboolean WebGL2RenderingContextBase::isTransformFeedback(WebGLTransformFeedback
      * feedback) | 2006 GLboolean WebGL2RenderingContextBase::isTransformFeedback(WebGLTransformFeedback
      * feedback) | 
| 2021 { | 2007 { | 
| 2022     if (isContextLost() || !feedback) | 2008     if (isContextLost() || !feedback) | 
| 2023         return 0; | 2009         return 0; | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 2036     if (deleted) { | 2022     if (deleted) { | 
| 2037         synthesizeGLError(GL_INVALID_OPERATION, "bindTransformFeedback", "attemp
      ted to bind a deleted transform feedback object"); | 2023         synthesizeGLError(GL_INVALID_OPERATION, "bindTransformFeedback", "attemp
      ted to bind a deleted transform feedback object"); | 
| 2038         return; | 2024         return; | 
| 2039     } | 2025     } | 
| 2040 | 2026 | 
| 2041     if (target != GL_TRANSFORM_FEEDBACK) { | 2027     if (target != GL_TRANSFORM_FEEDBACK) { | 
| 2042         synthesizeGLError(GL_INVALID_ENUM, "bindTransformFeedback", "target must
       be TRANSFORM_FEEDBACK"); | 2028         synthesizeGLError(GL_INVALID_ENUM, "bindTransformFeedback", "target must
       be TRANSFORM_FEEDBACK"); | 
| 2043         return; | 2029         return; | 
| 2044     } | 2030     } | 
| 2045 | 2031 | 
| 2046     if (transformFeedbackActive() && !transformFeedbackPaused()) { |  | 
| 2047         synthesizeGLError(GL_INVALID_OPERATION, "bindTransformFeedback", "transf
      orm feedback is active and not paused"); |  | 
| 2048         return; |  | 
| 2049     } |  | 
| 2050 |  | 
| 2051     m_transformFeedbackBinding = feedback; | 2032     m_transformFeedbackBinding = feedback; | 
| 2052 | 2033 | 
| 2053     contextGL()->BindTransformFeedback(target, objectOrZero(feedback)); | 2034     contextGL()->BindTransformFeedback(target, objectOrZero(feedback)); | 
| 2054     if (feedback) { | 2035     if (feedback) { | 
| 2055         feedback->setTarget(target); | 2036         feedback->setTarget(target); | 
| 2056         preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(script
      State->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedTransformFeed
      back), feedback); | 2037         preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(script
      State->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedTransformFeed
      back), feedback); | 
| 2057     } | 2038     } | 
| 2058 | 2039 | 
| 2059 } | 2040 } | 
| 2060 | 2041 | 
| 2061 void WebGL2RenderingContextBase::beginTransformFeedback(GLenum primitiveMode) | 2042 void WebGL2RenderingContextBase::beginTransformFeedback(GLenum primitiveMode) | 
| 2062 { | 2043 { | 
| 2063     if (isContextLost()) | 2044     if (isContextLost()) | 
| 2064         return; | 2045         return; | 
| 2065     if (!validateTransformFeedbackPrimitiveMode("beginTransformFeedback", primit
      iveMode)) | 2046     if (!validateTransformFeedbackPrimitiveMode("beginTransformFeedback", primit
      iveMode)) | 
| 2066         return; | 2047         return; | 
| 2067 | 2048 | 
| 2068     if (transformFeedbackActive()) { |  | 
| 2069         synthesizeGLError(GL_INVALID_OPERATION, "beginTransformFeedback", "trans
      form feedback is active"); |  | 
| 2070         return; |  | 
| 2071     } |  | 
| 2072 |  | 
| 2073     contextGL()->BeginTransformFeedback(primitiveMode); | 2049     contextGL()->BeginTransformFeedback(primitiveMode); | 
| 2074 | 2050 | 
| 2075     // TODO(kbr): there are many more reasons BeginTransformFeedback may fail, t
      he most |  | 
| 2076     // problematic being "if any binding point used in transform feedback mode d
      oes not |  | 
| 2077     // have a buffer object bound", and "if no binding points would be used". |  | 
| 2078     // crbug.com/448164 |  | 
| 2079     setTransformFeedbackActive(true); |  | 
| 2080 |  | 
| 2081     if (m_currentProgram) | 2051     if (m_currentProgram) | 
| 2082         m_currentProgram->increaseActiveTransformFeedbackCount(); | 2052         m_currentProgram->increaseActiveTransformFeedbackCount(); | 
| 2083 | 2053 | 
| 2084     if (m_transformFeedbackBinding) | 2054     if (m_transformFeedbackBinding) | 
| 2085         m_transformFeedbackBinding->setProgram(m_currentProgram); | 2055         m_transformFeedbackBinding->setProgram(m_currentProgram); | 
| 2086 } | 2056 } | 
| 2087 | 2057 | 
| 2088 void WebGL2RenderingContextBase::endTransformFeedback() | 2058 void WebGL2RenderingContextBase::endTransformFeedback() | 
| 2089 { | 2059 { | 
| 2090     if (isContextLost()) | 2060     if (isContextLost()) | 
| 2091         return; | 2061         return; | 
| 2092 | 2062 | 
| 2093     if (!transformFeedbackActive()) { |  | 
| 2094         synthesizeGLError(GL_INVALID_OPERATION, "endTransformFeedback", "transfo
      rm feedback is not active"); |  | 
| 2095         return; |  | 
| 2096     } |  | 
| 2097 |  | 
| 2098     contextGL()->EndTransformFeedback(); | 2063     contextGL()->EndTransformFeedback(); | 
| 2099 | 2064 | 
| 2100     setTransformFeedbackPaused(false); |  | 
| 2101     setTransformFeedbackActive(false); |  | 
| 2102 |  | 
| 2103     if (m_currentProgram) | 2065     if (m_currentProgram) | 
| 2104         m_currentProgram->decreaseActiveTransformFeedbackCount(); | 2066         m_currentProgram->decreaseActiveTransformFeedbackCount(); | 
| 2105 } | 2067 } | 
| 2106 | 2068 | 
| 2107 void WebGL2RenderingContextBase::transformFeedbackVaryings(WebGLProgram* program
      , const Vector<String>& varyings, GLenum bufferMode) | 2069 void WebGL2RenderingContextBase::transformFeedbackVaryings(WebGLProgram* program
      , const Vector<String>& varyings, GLenum bufferMode) | 
| 2108 { | 2070 { | 
| 2109     if (isContextLost() || !validateWebGLObject("transformFeedbackVaryings", pro
      gram)) | 2071     if (isContextLost() || !validateWebGLObject("transformFeedbackVaryings", pro
      gram)) | 
| 2110         return; | 2072         return; | 
| 2111 | 2073 | 
| 2112     switch (bufferMode) { | 2074     switch (bufferMode) { | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2165     } | 2127     } | 
| 2166 | 2128 | 
| 2167     return WebGLActiveInfo::create(String(name.get(), length), type, size); | 2129     return WebGLActiveInfo::create(String(name.get(), length), type, size); | 
| 2168 } | 2130 } | 
| 2169 | 2131 | 
| 2170 void WebGL2RenderingContextBase::pauseTransformFeedback() | 2132 void WebGL2RenderingContextBase::pauseTransformFeedback() | 
| 2171 { | 2133 { | 
| 2172     if (isContextLost()) | 2134     if (isContextLost()) | 
| 2173         return; | 2135         return; | 
| 2174 | 2136 | 
| 2175     if (!transformFeedbackActive() || transformFeedbackPaused()) { |  | 
| 2176         synthesizeGLError(GL_INVALID_OPERATION, "pauseTransformFeedback", "trans
      form feedback is not active or is paused"); |  | 
| 2177         return; |  | 
| 2178     } |  | 
| 2179 |  | 
| 2180     contextGL()->PauseTransformFeedback(); | 2137     contextGL()->PauseTransformFeedback(); | 
| 2181 |  | 
| 2182     setTransformFeedbackPaused(true); |  | 
| 2183 } | 2138 } | 
| 2184 | 2139 | 
| 2185 void WebGL2RenderingContextBase::resumeTransformFeedback() | 2140 void WebGL2RenderingContextBase::resumeTransformFeedback() | 
| 2186 { | 2141 { | 
| 2187     if (isContextLost()) | 2142     if (isContextLost()) | 
| 2188         return; | 2143         return; | 
| 2189 | 2144 | 
| 2190     if (!transformFeedbackActive() || !transformFeedbackPaused()) { |  | 
| 2191         synthesizeGLError(GL_INVALID_OPERATION, "resumeTransformFeedback", "tran
      sform feedback is not active or is not paused"); |  | 
| 2192         return; |  | 
| 2193     } |  | 
| 2194 |  | 
| 2195     if (m_transformFeedbackBinding && m_transformFeedbackBinding->getProgram() !
      = m_currentProgram) { | 2145     if (m_transformFeedbackBinding && m_transformFeedbackBinding->getProgram() !
      = m_currentProgram) { | 
| 2196         synthesizeGLError(GL_INVALID_OPERATION, "resumeTransformFeedback", "the 
      program object is not active"); | 2146         synthesizeGLError(GL_INVALID_OPERATION, "resumeTransformFeedback", "the 
      program object is not active"); | 
| 2197         return; | 2147         return; | 
| 2198     } | 2148     } | 
| 2199 | 2149 | 
| 2200     contextGL()->ResumeTransformFeedback(); | 2150     contextGL()->ResumeTransformFeedback(); | 
| 2201 |  | 
| 2202     setTransformFeedbackPaused(false); |  | 
| 2203 } | 2151 } | 
| 2204 | 2152 | 
| 2205 bool WebGL2RenderingContextBase::validateTransformFeedbackPrimitiveMode(const ch
      ar* functionName, GLenum primitiveMode) | 2153 bool WebGL2RenderingContextBase::validateTransformFeedbackPrimitiveMode(const ch
      ar* functionName, GLenum primitiveMode) | 
| 2206 { | 2154 { | 
| 2207     switch (primitiveMode) { | 2155     switch (primitiveMode) { | 
| 2208     case GL_POINTS: | 2156     case GL_POINTS: | 
| 2209     case GL_LINES: | 2157     case GL_LINES: | 
| 2210     case GL_TRIANGLES: | 2158     case GL_TRIANGLES: | 
| 2211         return true; | 2159         return true; | 
| 2212     default: | 2160     default: | 
| 2213         synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid transform feed
      back primitive mode"); | 2161         synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid transform feed
      back primitive mode"); | 
| 2214         return false; | 2162         return false; | 
| 2215     } | 2163     } | 
| 2216 } | 2164 } | 
| 2217 | 2165 | 
| 2218 void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, Web
      GLBuffer* buffer) | 2166 void WebGL2RenderingContextBase::bindBufferBase(GLenum target, GLuint index, Web
      GLBuffer* buffer) | 
| 2219 { | 2167 { | 
| 2220     if (isContextLost()) | 2168     if (isContextLost()) | 
| 2221         return; | 2169         return; | 
| 2222     bool deleted; | 2170     bool deleted; | 
| 2223     if (!checkObjectToBeBound("bindBufferBase", buffer, deleted)) | 2171     if (!checkObjectToBeBound("bindBufferBase", buffer, deleted)) | 
| 2224         return; | 2172         return; | 
| 2225     if (deleted) | 2173     if (deleted) | 
| 2226         buffer = 0; | 2174         buffer = 0; | 
| 2227     if (!validateAndUpdateBufferBindBaseTarget("bindBufferBase", target, index, 
      buffer)) | 2175     if (!validateAndUpdateBufferBindBaseTarget("bindBufferBase", target, index, 
      buffer)) | 
| 2228         return; | 2176         return; | 
| 2229 | 2177 | 
| 2230     // ES 3.0.4 spec section 2.15.2 "Transform Feedback Primitive Capture" |  | 
| 2231     if (target == GL_TRANSFORM_FEEDBACK_BUFFER && transformFeedbackActive()) { |  | 
| 2232         synthesizeGLError(GL_INVALID_OPERATION, "bindBufferBase", "target is TRA
      NSFORM_FEEDBACK_BUFFER and transform feedback is active"); |  | 
| 2233         return; |  | 
| 2234     } |  | 
| 2235 |  | 
| 2236     contextGL()->BindBufferBase(target, index, objectOrZero(buffer)); | 2178     contextGL()->BindBufferBase(target, index, objectOrZero(buffer)); | 
| 2237 } | 2179 } | 
| 2238 | 2180 | 
| 2239 void WebGL2RenderingContextBase::bindBufferRange(GLenum target, GLuint index, We
      bGLBuffer* buffer, long long offset, long long size) | 2181 void WebGL2RenderingContextBase::bindBufferRange(GLenum target, GLuint index, We
      bGLBuffer* buffer, long long offset, long long size) | 
| 2240 { | 2182 { | 
| 2241     if (isContextLost()) | 2183     if (isContextLost()) | 
| 2242         return; | 2184         return; | 
| 2243     bool deleted; | 2185     bool deleted; | 
| 2244     if (!checkObjectToBeBound("bindBufferRange", buffer, deleted)) | 2186     if (!checkObjectToBeBound("bindBufferRange", buffer, deleted)) | 
| 2245         return; | 2187         return; | 
| 2246     if (deleted) | 2188     if (deleted) | 
| 2247         buffer = 0; | 2189         buffer = 0; | 
| 2248     if (!validateValueFitNonNegInt32("bindBufferRange", "offset", offset) | 2190     if (!validateValueFitNonNegInt32("bindBufferRange", "offset", offset) | 
| 2249         || !validateValueFitNonNegInt32("bindBufferRange", "size", size)) { | 2191         || !validateValueFitNonNegInt32("bindBufferRange", "size", size)) { | 
| 2250         return; | 2192         return; | 
| 2251     } | 2193     } | 
| 2252 | 2194 | 
| 2253     // ES 3.0.4 spec section 2.15.2 "Transform Feedback Primitive Capture" |  | 
| 2254     if (target == GL_TRANSFORM_FEEDBACK_BUFFER && transformFeedbackActive()) { |  | 
| 2255         synthesizeGLError(GL_INVALID_OPERATION, "bindBufferRange", "target is TR
      ANSFORM_FEEDBACK_BUFFER and transform feedback is active"); |  | 
| 2256         return; |  | 
| 2257     } |  | 
| 2258 |  | 
| 2259     if (!validateAndUpdateBufferBindBaseTarget("bindBufferRange", target, index,
       buffer)) | 2195     if (!validateAndUpdateBufferBindBaseTarget("bindBufferRange", target, index,
       buffer)) | 
| 2260         return; | 2196         return; | 
| 2261 | 2197 | 
| 2262     contextGL()->BindBufferRange(target, index, objectOrZero(buffer), static_cas
      t<GLintptr>(offset), static_cast<GLsizeiptr>(size)); | 2198     contextGL()->BindBufferRange(target, index, objectOrZero(buffer), static_cas
      t<GLintptr>(offset), static_cast<GLsizeiptr>(size)); | 
| 2263 } | 2199 } | 
| 2264 | 2200 | 
| 2265 bool WebGL2RenderingContextBase::transformFeedbackActive() const |  | 
| 2266 { |  | 
| 2267     if (m_transformFeedbackBinding) |  | 
| 2268         return m_transformFeedbackBinding->isActive(); |  | 
| 2269     return false; |  | 
| 2270 } |  | 
| 2271 |  | 
| 2272 bool WebGL2RenderingContextBase::transformFeedbackPaused() const |  | 
| 2273 { |  | 
| 2274     if (m_transformFeedbackBinding) |  | 
| 2275         return m_transformFeedbackBinding->isPaused(); |  | 
| 2276     return false; |  | 
| 2277 } |  | 
| 2278 |  | 
| 2279 void WebGL2RenderingContextBase::setTransformFeedbackActive(bool transformFeedba
      ckActive) |  | 
| 2280 { |  | 
| 2281     if (m_transformFeedbackBinding) |  | 
| 2282         m_transformFeedbackBinding->setActive(transformFeedbackActive); |  | 
| 2283 } |  | 
| 2284 |  | 
| 2285 void WebGL2RenderingContextBase::setTransformFeedbackPaused(bool transformFeedba
      ckPaused) |  | 
| 2286 { |  | 
| 2287     if (m_transformFeedbackBinding) |  | 
| 2288         m_transformFeedbackBinding->setPaused(transformFeedbackPaused); |  | 
| 2289 } |  | 
| 2290 |  | 
| 2291 ScriptValue WebGL2RenderingContextBase::getIndexedParameter(ScriptState* scriptS
      tate, GLenum target, GLuint index) | 2201 ScriptValue WebGL2RenderingContextBase::getIndexedParameter(ScriptState* scriptS
      tate, GLenum target, GLuint index) | 
| 2292 { | 2202 { | 
| 2293     if (isContextLost()) | 2203     if (isContextLost()) | 
| 2294         return ScriptValue::createNull(scriptState); | 2204         return ScriptValue::createNull(scriptState); | 
| 2295 | 2205 | 
| 2296     switch (target) { | 2206     switch (target) { | 
| 2297     case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: | 2207     case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: | 
| 2298         if (index >= m_boundIndexedTransformFeedbackBuffers.size()) { | 2208         if (index >= m_boundIndexedTransformFeedbackBuffers.size()) { | 
| 2299             synthesizeGLError(GL_INVALID_VALUE, "getIndexedParameter", "index ou
      t of range"); | 2209             synthesizeGLError(GL_INVALID_VALUE, "getIndexedParameter", "index ou
      t of range"); | 
| 2300             return ScriptValue::createNull(scriptState); | 2210             return ScriptValue::createNull(scriptState); | 
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2728         return getBooleanParameter(scriptState, pname); | 2638         return getBooleanParameter(scriptState, pname); | 
| 2729     case GL_SAMPLE_COVERAGE: | 2639     case GL_SAMPLE_COVERAGE: | 
| 2730         return getBooleanParameter(scriptState, pname); | 2640         return getBooleanParameter(scriptState, pname); | 
| 2731     case GL_SAMPLER_BINDING: | 2641     case GL_SAMPLER_BINDING: | 
| 2732         return WebGLAny(scriptState, m_samplerUnits[m_activeTextureUnit].get()); | 2642         return WebGLAny(scriptState, m_samplerUnits[m_activeTextureUnit].get()); | 
| 2733     case GL_TEXTURE_BINDING_2D_ARRAY: | 2643     case GL_TEXTURE_BINDING_2D_ARRAY: | 
| 2734         return WebGLAny(scriptState, m_textureUnits[m_activeTextureUnit].m_textu
      re2DArrayBinding.get()); | 2644         return WebGLAny(scriptState, m_textureUnits[m_activeTextureUnit].m_textu
      re2DArrayBinding.get()); | 
| 2735     case GL_TEXTURE_BINDING_3D: | 2645     case GL_TEXTURE_BINDING_3D: | 
| 2736         return WebGLAny(scriptState, m_textureUnits[m_activeTextureUnit].m_textu
      re3DBinding.get()); | 2646         return WebGLAny(scriptState, m_textureUnits[m_activeTextureUnit].m_textu
      re3DBinding.get()); | 
| 2737     case GL_TRANSFORM_FEEDBACK_ACTIVE: | 2647     case GL_TRANSFORM_FEEDBACK_ACTIVE: | 
| 2738         return WebGLAny(scriptState, transformFeedbackActive()); | 2648         return getBooleanParameter(scriptState, pname); | 
| 2739     case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: | 2649     case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: | 
| 2740         return WebGLAny(scriptState, m_boundTransformFeedbackBuffer.get()); | 2650         return WebGLAny(scriptState, m_boundTransformFeedbackBuffer.get()); | 
| 2741     case GL_TRANSFORM_FEEDBACK_BINDING: | 2651     case GL_TRANSFORM_FEEDBACK_BINDING: | 
| 2742         return WebGLAny(scriptState, m_transformFeedbackBinding.get()); | 2652         return WebGLAny(scriptState, m_transformFeedbackBinding.get()); | 
| 2743     case GL_TRANSFORM_FEEDBACK_PAUSED: | 2653     case GL_TRANSFORM_FEEDBACK_PAUSED: | 
| 2744         return WebGLAny(scriptState, transformFeedbackPaused()); | 2654         return getBooleanParameter(scriptState, pname); | 
| 2745     case GL_UNIFORM_BUFFER_BINDING: | 2655     case GL_UNIFORM_BUFFER_BINDING: | 
| 2746         return WebGLAny(scriptState, m_boundUniformBuffer.get()); | 2656         return WebGLAny(scriptState, m_boundUniformBuffer.get()); | 
| 2747     case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: | 2657     case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: | 
| 2748         return getIntParameter(scriptState, pname); | 2658         return getIntParameter(scriptState, pname); | 
| 2749     case GL_UNPACK_IMAGE_HEIGHT: | 2659     case GL_UNPACK_IMAGE_HEIGHT: | 
| 2750         return getIntParameter(scriptState, pname); | 2660         return getIntParameter(scriptState, pname); | 
| 2751     case GL_UNPACK_ROW_LENGTH: | 2661     case GL_UNPACK_ROW_LENGTH: | 
| 2752         return getIntParameter(scriptState, pname); | 2662         return getIntParameter(scriptState, pname); | 
| 2753     case GL_UNPACK_SKIP_IMAGES: | 2663     case GL_UNPACK_SKIP_IMAGES: | 
| 2754         return getIntParameter(scriptState, pname); | 2664         return getIntParameter(scriptState, pname); | 
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3459     params.skipPixels = m_unpackSkipPixels; | 3369     params.skipPixels = m_unpackSkipPixels; | 
| 3460     params.skipRows = m_unpackSkipRows; | 3370     params.skipRows = m_unpackSkipRows; | 
| 3461     if (dimension == Tex3D) { | 3371     if (dimension == Tex3D) { | 
| 3462         params.imageHeight = m_unpackImageHeight; | 3372         params.imageHeight = m_unpackImageHeight; | 
| 3463         params.skipImages = m_unpackSkipImages; | 3373         params.skipImages = m_unpackSkipImages; | 
| 3464     } | 3374     } | 
| 3465     return params; | 3375     return params; | 
| 3466 } | 3376 } | 
| 3467 | 3377 | 
| 3468 } // namespace blink | 3378 } // namespace blink | 
| OLD | NEW | 
|---|