| 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 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2232 void WebGLRenderingContextBase::drawElements(GLenum mode, GLsizei count, GLenum 
      type, long long offset) | 2232 void WebGLRenderingContextBase::drawElements(GLenum mode, GLsizei count, GLenum 
      type, long long offset) | 
| 2233 { | 2233 { | 
| 2234     if (!validateDrawElements("drawElements", type, offset)) | 2234     if (!validateDrawElements("drawElements", type, offset)) | 
| 2235         return; | 2235         return; | 
| 2236 | 2236 | 
| 2237     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 2237     if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { | 
| 2238         synthesizeGLError(GL_INVALID_OPERATION, "drawElements", "no buffer is bo
      und to enabled attribute"); | 2238         synthesizeGLError(GL_INVALID_OPERATION, "drawElements", "no buffer is bo
      und to enabled attribute"); | 
| 2239         return; | 2239         return; | 
| 2240     } | 2240     } | 
| 2241 | 2241 | 
| 2242     if (transformFeedbackActive() && !transformFeedbackPaused()) { |  | 
| 2243         synthesizeGLError(GL_INVALID_OPERATION, "drawElements", "transform feedb
      ack is active and not paused"); |  | 
| 2244         return; |  | 
| 2245     } |  | 
| 2246 |  | 
| 2247     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 2242     ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_d
      rawingBuffer.get()); | 
| 2248     clearIfComposited(); | 2243     clearIfComposited(); | 
| 2249     contextGL()->DrawElements(mode, count, type, reinterpret_cast<void*>(static_
      cast<intptr_t>(offset))); | 2244     contextGL()->DrawElements(mode, count, type, reinterpret_cast<void*>(static_
      cast<intptr_t>(offset))); | 
| 2250     markContextChanged(CanvasChanged); | 2245     markContextChanged(CanvasChanged); | 
| 2251 } | 2246 } | 
| 2252 | 2247 | 
| 2253 void WebGLRenderingContextBase::drawArraysInstancedANGLE(GLenum mode, GLint firs
      t, GLsizei count, GLsizei primcount) | 2248 void WebGLRenderingContextBase::drawArraysInstancedANGLE(GLenum mode, GLint firs
      t, GLsizei count, GLsizei primcount) | 
| 2254 { | 2249 { | 
| 2255     if (!validateDrawArrays("drawArraysInstancedANGLE")) | 2250     if (!validateDrawArrays("drawArraysInstancedANGLE")) | 
| 2256         return; | 2251         return; | 
| (...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4917     bool deleted; | 4912     bool deleted; | 
| 4918     if (!checkObjectToBeBound("useProgram", program, deleted)) | 4913     if (!checkObjectToBeBound("useProgram", program, deleted)) | 
| 4919         return; | 4914         return; | 
| 4920     if (deleted) | 4915     if (deleted) | 
| 4921         program = 0; | 4916         program = 0; | 
| 4922     if (program && !program->linkStatus(this)) { | 4917     if (program && !program->linkStatus(this)) { | 
| 4923         synthesizeGLError(GL_INVALID_OPERATION, "useProgram", "program not valid
      "); | 4918         synthesizeGLError(GL_INVALID_OPERATION, "useProgram", "program not valid
      "); | 
| 4924         return; | 4919         return; | 
| 4925     } | 4920     } | 
| 4926 | 4921 | 
| 4927     if (transformFeedbackActive() && !transformFeedbackPaused()) { |  | 
| 4928         synthesizeGLError(GL_INVALID_OPERATION, "useProgram", "transform feedbac
      k is active and not paused"); |  | 
| 4929         return; |  | 
| 4930     } |  | 
| 4931 |  | 
| 4932     if (m_currentProgram != program) { | 4922     if (m_currentProgram != program) { | 
| 4933         if (m_currentProgram) | 4923         if (m_currentProgram) | 
| 4934             m_currentProgram->onDetached(contextGL()); | 4924             m_currentProgram->onDetached(contextGL()); | 
| 4935         m_currentProgram = program; | 4925         m_currentProgram = program; | 
| 4936         contextGL()->UseProgram(objectOrZero(program)); | 4926         contextGL()->UseProgram(objectOrZero(program)); | 
| 4937         if (program) | 4927         if (program) | 
| 4938             program->onAttached(); | 4928             program->onAttached(); | 
| 4939         preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(script
      State->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedProgram), pro
      gram); | 4929         preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(script
      State->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedProgram), pro
      gram); | 
| 4940     } | 4930     } | 
| 4941 } | 4931 } | 
| (...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6435         contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6425         contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 
| 6436 } | 6426 } | 
| 6437 | 6427 | 
| 6438 void WebGLRenderingContextBase::restoreUnpackParameters() | 6428 void WebGLRenderingContextBase::restoreUnpackParameters() | 
| 6439 { | 6429 { | 
| 6440     if (m_unpackAlignment != 1) | 6430     if (m_unpackAlignment != 1) | 
| 6441         contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6431         contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 
| 6442 } | 6432 } | 
| 6443 | 6433 | 
| 6444 } // namespace blink | 6434 } // namespace blink | 
| OLD | NEW | 
|---|