| 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 6000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6011 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: | 6011 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: |
| 6012 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: | 6012 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: |
| 6013 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: | 6013 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: |
| 6014 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: | 6014 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: |
| 6015 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: | 6015 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: |
| 6016 { | 6016 { |
| 6017 const int index = (format < GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR)
? | 6017 const int index = (format < GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR)
? |
| 6018 (int)format - GL_COMPRESSED_RGBA_ASTC_4x4_KHR : (int)format - GL
_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; | 6018 (int)format - GL_COMPRESSED_RGBA_ASTC_4x4_KHR : (int)format - GL
_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; |
| 6019 | 6019 |
| 6020 const int kBlockSize = 16; | 6020 const int kBlockSize = 16; |
| 6021 const int kBlockWidth = WebGLCompressedTextureASTC::kBlockSizeCompre
ssASTC[index].blockWidth; | 6021 const int blockWidth = WebGLCompressedTextureASTC::kBlockSizeCompres
sASTC[index].blockWidth; |
| 6022 const int kBlockHeight = WebGLCompressedTextureASTC::kBlockSizeCompr
essASTC[index].blockHeight; | 6022 const int blockHeight = WebGLCompressedTextureASTC::kBlockSizeCompre
ssASTC[index].blockHeight; |
| 6023 | 6023 |
| 6024 CheckedInt<unsigned> numBlocksAcross = (CheckedInt<unsigned>(width)
+ kBlockWidth - 1) / kBlockWidth; | 6024 CheckedInt<unsigned> numBlocksAcross = (CheckedInt<unsigned>(width)
+ blockWidth - 1) / blockWidth; |
| 6025 CheckedInt<unsigned> numBlocksDown = (CheckedInt<unsigned>(height) +
kBlockHeight - 1) / kBlockHeight; | 6025 CheckedInt<unsigned> numBlocksDown = (CheckedInt<unsigned>(height) +
blockHeight - 1) / blockHeight; |
| 6026 CheckedInt<unsigned> numBlocks = numBlocksAcross * numBlocksDown; | 6026 CheckedInt<unsigned> numBlocks = numBlocksAcross * numBlocksDown; |
| 6027 bytesRequired = numBlocks * kBlockSize; | 6027 bytesRequired = numBlocks * kBlockSize; |
| 6028 } | 6028 } |
| 6029 break; | 6029 break; |
| 6030 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | 6030 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
| 6031 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: | 6031 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: |
| 6032 { | 6032 { |
| 6033 const int kBlockWidth = 4; | 6033 const int kBlockWidth = 4; |
| 6034 const int kBlockHeight = 4; | 6034 const int kBlockHeight = 4; |
| 6035 const int kBlockSize = 8; | 6035 const int kBlockSize = 8; |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7000 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 7000 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 7001 } | 7001 } |
| 7002 | 7002 |
| 7003 void WebGLRenderingContextBase::restoreUnpackParameters() | 7003 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 7004 { | 7004 { |
| 7005 if (m_unpackAlignment != 1) | 7005 if (m_unpackAlignment != 1) |
| 7006 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 7006 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 7007 } | 7007 } |
| 7008 | 7008 |
| 7009 } // namespace blink | 7009 } // namespace blink |
| OLD | NEW |