| 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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 } | 2374 } |
| 2375 | 2375 |
| 2376 void WebGLRenderingContextBase::generateMipmap(GLenum target) | 2376 void WebGLRenderingContextBase::generateMipmap(GLenum target) |
| 2377 { | 2377 { |
| 2378 if (isContextLost()) | 2378 if (isContextLost()) |
| 2379 return; | 2379 return; |
| 2380 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); | 2380 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); |
| 2381 if (!tex) | 2381 if (!tex) |
| 2382 return; | 2382 return; |
| 2383 if (!tex->canGenerateMipmaps()) { | 2383 if (!tex->canGenerateMipmaps()) { |
| 2384 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "level 0 not p
ower of 2 or not all the same size"); | 2384 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps"); |
| 2385 return; | 2385 return; |
| 2386 } | 2386 } |
| 2387 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm
at(target, 0) == GL_SRGB_ALPHA_EXT) { | 2387 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm
at(target, 0) == GL_SRGB_ALPHA_EXT) { |
| 2388 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps for sRGB textures"); | 2388 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps for sRGB textures"); |
| 2389 return; | 2389 return; |
| 2390 } | 2390 } |
| 2391 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ
et, 0))) | 2391 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ
et, 0))) |
| 2392 return; | 2392 return; |
| 2393 | 2393 |
| 2394 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN
EAR | 2394 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN
EAR |
| (...skipping 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6716 | 6716 |
| 6717 return totalBytesPerPixel; | 6717 return totalBytesPerPixel; |
| 6718 } | 6718 } |
| 6719 | 6719 |
| 6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6720 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
| 6721 { | 6721 { |
| 6722 return m_drawingBuffer.get(); | 6722 return m_drawingBuffer.get(); |
| 6723 } | 6723 } |
| 6724 | 6724 |
| 6725 } // namespace blink | 6725 } // namespace blink |
| OLD | NEW |