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 3765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3776 | 3776 |
3777 if (m_unpackAlignment != 1) | 3777 if (m_unpackAlignment != 1) |
3778 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1); | 3778 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1); |
3779 texImage2DBase(target, level, internalformat, image->width(), image->height(
), 0, format, type, needConversion ? data.data() : imagePixelData, ec); | 3779 texImage2DBase(target, level, internalformat, image->width(), image->height(
), 0, format, type, needConversion ? data.data() : imagePixelData, ec); |
3780 if (m_unpackAlignment != 1) | 3780 if (m_unpackAlignment != 1) |
3781 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlig
nment); | 3781 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlig
nment); |
3782 } | 3782 } |
3783 | 3783 |
3784 bool WebGLRenderingContext::validateTexFunc(const char* functionName, TexFuncVal
idationFunctionType functionType, TexFuncValidationSourceType sourceType, GC3Den
um target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei he
ight, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint xoffset, GC3Dint y
offset) | 3784 bool WebGLRenderingContext::validateTexFunc(const char* functionName, TexFuncVal
idationFunctionType functionType, TexFuncValidationSourceType sourceType, GC3Den
um target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei he
ight, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint xoffset, GC3Dint y
offset) |
3785 { | 3785 { |
3786 // FIXME: Uploading {ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVid
eoElement} to half floating point texture is not supported yet. | |
3787 // See https://bugs.webkit.org/show_bug.cgi?id=110936. | |
3788 if (sourceType != SourceArrayBufferView && type == GraphicsContext3D::HALF_F
LOAT_OES) { | |
3789 synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "O
peration not supported yet"); | |
3790 return false; | |
3791 } | |
3792 | |
3793 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) | 3786 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) |
3794 return false; | 3787 return false; |
3795 | 3788 |
3796 WebGLTexture* texture = validateTextureBinding(functionName, target, true); | 3789 WebGLTexture* texture = validateTextureBinding(functionName, target, true); |
3797 if (!texture) | 3790 if (!texture) |
3798 return false; | 3791 return false; |
3799 | 3792 |
3800 if (functionType == NotTexSubImage2D) { | 3793 if (functionType == NotTexSubImage2D) { |
3801 if (level && WebGLTexture::isNPOT(width, height)) { | 3794 if (level && WebGLTexture::isNPOT(width, height)) { |
3802 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "l
evel > 0 not power of 2"); | 3795 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "l
evel > 0 not power of 2"); |
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6092 bool WebGLRenderingContext::supportsDrawBuffers() | 6085 bool WebGLRenderingContext::supportsDrawBuffers() |
6093 { | 6086 { |
6094 if (!m_drawBuffersWebGLRequirementsChecked) { | 6087 if (!m_drawBuffersWebGLRequirementsChecked) { |
6095 m_drawBuffersWebGLRequirementsChecked = true; | 6088 m_drawBuffersWebGLRequirementsChecked = true; |
6096 m_drawBuffersSupported = EXTDrawBuffers::supported(this); | 6089 m_drawBuffersSupported = EXTDrawBuffers::supported(this); |
6097 } | 6090 } |
6098 return m_drawBuffersSupported; | 6091 return m_drawBuffersSupported; |
6099 } | 6092 } |
6100 | 6093 |
6101 } // namespace WebCore | 6094 } // namespace WebCore |
OLD | NEW |