| 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 5464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5475 } | 5475 } |
| 5476 } | 5476 } |
| 5477 return true; | 5477 return true; |
| 5478 } | 5478 } |
| 5479 | 5479 |
| 5480 bool WebGLRenderingContextBase::validateShaderSource(const String& string) | 5480 bool WebGLRenderingContextBase::validateShaderSource(const String& string) |
| 5481 { | 5481 { |
| 5482 for (size_t i = 0; i < string.length(); ++i) { | 5482 for (size_t i = 0; i < string.length(); ++i) { |
| 5483 // line-continuation character \ is supported in WebGL 2.0. | 5483 // line-continuation character \ is supported in WebGL 2.0. |
| 5484 if (isWebGL2OrHigher() && string[i] == '\\') { | 5484 if (isWebGL2OrHigher() && string[i] == '\\') { |
| 5485 if (i + 1 >= string.length() || (string[i + 1] != '\n' && string[i +
1] != '\r')) { | |
| 5486 synthesizeGLError(GL_INVALID_VALUE, "shaderSource", "line-contin
uation character is not immediately preceding a new-line"); | |
| 5487 return false; | |
| 5488 } | |
| 5489 continue; | 5485 continue; |
| 5490 } | 5486 } |
| 5491 if (!validateCharacter(string[i])) { | 5487 if (!validateCharacter(string[i])) { |
| 5492 synthesizeGLError(GL_INVALID_VALUE, "shaderSource", "string not ASCI
I"); | 5488 synthesizeGLError(GL_INVALID_VALUE, "shaderSource", "string not ASCI
I"); |
| 5493 return false; | 5489 return false; |
| 5494 } | 5490 } |
| 5495 } | 5491 } |
| 5496 return true; | 5492 return true; |
| 5497 } | 5493 } |
| 5498 | 5494 |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6471 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6467 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6472 } | 6468 } |
| 6473 | 6469 |
| 6474 void WebGLRenderingContextBase::restoreUnpackParameters() | 6470 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6475 { | 6471 { |
| 6476 if (m_unpackAlignment != 1) | 6472 if (m_unpackAlignment != 1) |
| 6477 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6473 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6478 } | 6474 } |
| 6479 | 6475 |
| 6480 } // namespace blink | 6476 } // namespace blink |
| OLD | NEW |