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 4105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4116 functionType = TexImage; | 4116 functionType = TexImage; |
| 4117 else | 4117 else |
| 4118 functionType = TexSubImage; | 4118 functionType = TexSubImage; |
| 4119 if (!validateTexFunc(funcName, functionType, SourceArrayBufferView, target, level, internalformat, width, height, depth, border, format, type, xoffset, yoff set, zoffset)) | 4119 if (!validateTexFunc(funcName, functionType, SourceArrayBufferView, target, level, internalformat, width, height, depth, border, format, type, xoffset, yoff set, zoffset)) |
| 4120 return; | 4120 return; |
| 4121 TexImageDimension sourceType; | 4121 TexImageDimension sourceType; |
| 4122 if (functionID == TexImage2D || functionID == TexSubImage2D) | 4122 if (functionID == TexImage2D || functionID == TexSubImage2D) |
| 4123 sourceType = Tex2D; | 4123 sourceType = Tex2D; |
| 4124 else | 4124 else |
| 4125 sourceType = Tex3D; | 4125 sourceType = Tex3D; |
| 4126 if (!validateTexFuncData(funcName, sourceType, level, width, height, depth, format, type, pixels, NullAllowed)) | 4126 if ((functionType == TexImage && !validateTexFuncData(funcName, sourceType, level, width, height, depth, format, type, pixels, NullAllowed)) |
| 4127 || (functionType == TexSubImage && !validateTexFuncData(funcName, source Type, level, width, height, depth, format, type, pixels, NullNotAllowed))) | |
|
Ken Russell (switch to Gerrit)
2016/06/08 21:13:07
It would be better to add a "switch" statement her
xidachen
2016/06/09 01:12:08
Done.
| |
| 4127 return; | 4128 return; |
| 4128 void* data = pixels ? pixels->baseAddress() : 0; | 4129 void* data = pixels ? pixels->baseAddress() : 0; |
| 4129 Vector<uint8_t> tempData; | 4130 Vector<uint8_t> tempData; |
| 4130 bool changeUnpackAlignment = false; | 4131 bool changeUnpackAlignment = false; |
| 4131 if (data && (m_unpackFlipY || m_unpackPremultiplyAlpha)) { | 4132 if (data && (m_unpackFlipY || m_unpackPremultiplyAlpha)) { |
| 4132 if (sourceType == Tex2D) { | 4133 if (sourceType == Tex2D) { |
| 4133 if (!WebGLImageConversion::extractTextureData(width, height, format, type, m_unpackAlignment, m_unpackFlipY, m_unpackPremultiplyAlpha, data, tempDat a)) | 4134 if (!WebGLImageConversion::extractTextureData(width, height, format, type, m_unpackAlignment, m_unpackFlipY, m_unpackPremultiplyAlpha, data, tempDat a)) |
| 4134 return; | 4135 return; |
| 4135 data = tempData.data(); | 4136 data = tempData.data(); |
| 4136 } | 4137 } |
| (...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6425 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6426 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6426 } | 6427 } |
| 6427 | 6428 |
| 6428 void WebGLRenderingContextBase::restoreUnpackParameters() | 6429 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6429 { | 6430 { |
| 6430 if (m_unpackAlignment != 1) | 6431 if (m_unpackAlignment != 1) |
| 6431 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6432 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6432 } | 6433 } |
| 6433 | 6434 |
| 6434 } // namespace blink | 6435 } // namespace blink |
| OLD | NEW |