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 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3683 | 3683 |
3684 if (m_unpackAlignment != 1) | 3684 if (m_unpackAlignment != 1) |
3685 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1); | 3685 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1); |
3686 texImage2DBase(target, level, internalformat, image->width(), image->height(
), 0, format, type, needConversion ? data.data() : imagePixelData, ec); | 3686 texImage2DBase(target, level, internalformat, image->width(), image->height(
), 0, format, type, needConversion ? data.data() : imagePixelData, ec); |
3687 if (m_unpackAlignment != 1) | 3687 if (m_unpackAlignment != 1) |
3688 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlig
nment); | 3688 m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlig
nment); |
3689 } | 3689 } |
3690 | 3690 |
3691 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) | 3691 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) |
3692 { | 3692 { |
3693 // FIXME: Uploading {ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVid
eoElement} to half floating point texture is not supported yet. | |
3694 // See https://bugs.webkit.org/show_bug.cgi?id=110936. | |
3695 if (sourceType != SourceArrayBufferView && type == GraphicsContext3D::HALF_F
LOAT_OES) { | |
3696 synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "O
peration not supported yet"); | |
3697 return false; | |
3698 } | |
3699 | |
3700 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) | 3693 if (!validateTexFuncParameters(functionName, functionType, target, level, in
ternalformat, width, height, border, format, type)) |
3701 return false; | 3694 return false; |
3702 | 3695 |
3703 WebGLTexture* texture = validateTextureBinding(functionName, target, true); | 3696 WebGLTexture* texture = validateTextureBinding(functionName, target, true); |
3704 if (!texture) | 3697 if (!texture) |
3705 return false; | 3698 return false; |
3706 | 3699 |
3707 if (functionType == NotTexSubImage2D) { | 3700 if (functionType == NotTexSubImage2D) { |
3708 if (level && WebGLTexture::isNPOT(width, height)) { | 3701 if (level && WebGLTexture::isNPOT(width, height)) { |
3709 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "l
evel > 0 not power of 2"); | 3702 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "l
evel > 0 not power of 2"); |
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6002 bool WebGLRenderingContext::supportsDrawBuffers() | 5995 bool WebGLRenderingContext::supportsDrawBuffers() |
6003 { | 5996 { |
6004 if (!m_drawBuffersWebGLRequirementsChecked) { | 5997 if (!m_drawBuffersWebGLRequirementsChecked) { |
6005 m_drawBuffersWebGLRequirementsChecked = true; | 5998 m_drawBuffersWebGLRequirementsChecked = true; |
6006 m_drawBuffersSupported = EXTDrawBuffers::supported(this); | 5999 m_drawBuffersSupported = EXTDrawBuffers::supported(this); |
6007 } | 6000 } |
6008 return m_drawBuffersSupported; | 6001 return m_drawBuffersSupported; |
6009 } | 6002 } |
6010 | 6003 |
6011 } // namespace WebCore | 6004 } // namespace WebCore |
OLD | NEW |