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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 } | 2363 } |
2364 | 2364 |
2365 void WebGLRenderingContextBase::generateMipmap(GLenum target) | 2365 void WebGLRenderingContextBase::generateMipmap(GLenum target) |
2366 { | 2366 { |
2367 if (isContextLost()) | 2367 if (isContextLost()) |
2368 return; | 2368 return; |
2369 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); | 2369 WebGLTexture* tex = validateTextureBinding("generateMipmap", target, false); |
2370 if (!tex) | 2370 if (!tex) |
2371 return; | 2371 return; |
2372 if (!tex->canGenerateMipmaps()) { | 2372 if (!tex->canGenerateMipmaps()) { |
2373 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "level 0 not p
ower of 2 or not all the same size"); | 2373 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps"); |
2374 return; | 2374 return; |
2375 } | 2375 } |
2376 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm
at(target, 0) == GL_SRGB_ALPHA_EXT) { | 2376 if (tex->getInternalFormat(target, 0) == GL_SRGB_EXT || tex->getInternalForm
at(target, 0) == GL_SRGB_ALPHA_EXT) { |
2377 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps for sRGB textures"); | 2377 synthesizeGLError(GL_INVALID_OPERATION, "generateMipmap", "cannot genera
te mipmaps for sRGB textures"); |
2378 return; | 2378 return; |
2379 } | 2379 } |
2380 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ
et, 0))) | 2380 if (!validateSettableTexFormat("generateMipmap", tex->getInternalFormat(targ
et, 0))) |
2381 return; | 2381 return; |
2382 | 2382 |
2383 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN
EAR | 2383 // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LIN
EAR |
(...skipping 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6687 | 6687 |
6688 return totalBytesPerPixel; | 6688 return totalBytesPerPixel; |
6689 } | 6689 } |
6690 | 6690 |
6691 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6691 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6692 { | 6692 { |
6693 return m_drawingBuffer.get(); | 6693 return m_drawingBuffer.get(); |
6694 } | 6694 } |
6695 | 6695 |
6696 } // namespace blink | 6696 } // namespace blink |
OLD | NEW |