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 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2859 case GL_MAX_COLOR_ATTACHMENTS_EXT: // EXT_draw_buffers BEGIN | 2859 case GL_MAX_COLOR_ATTACHMENTS_EXT: // EXT_draw_buffers BEGIN |
2860 if (extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) | 2860 if (extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) |
2861 return WebGLAny(scriptState, maxColorAttachments()); | 2861 return WebGLAny(scriptState, maxColorAttachments()); |
2862 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na me, WEBGL_draw_buffers not enabled"); | 2862 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na me, WEBGL_draw_buffers not enabled"); |
2863 return ScriptValue::createNull(scriptState); | 2863 return ScriptValue::createNull(scriptState); |
2864 case GL_MAX_DRAW_BUFFERS_EXT: | 2864 case GL_MAX_DRAW_BUFFERS_EXT: |
2865 if (extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) | 2865 if (extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) |
2866 return WebGLAny(scriptState, maxDrawBuffers()); | 2866 return WebGLAny(scriptState, maxDrawBuffers()); |
2867 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na me, WEBGL_draw_buffers not enabled"); | 2867 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na me, WEBGL_draw_buffers not enabled"); |
2868 return ScriptValue::createNull(scriptState); | 2868 return ScriptValue::createNull(scriptState); |
2869 case GL_TIMESTAMP_EXT: | |
2870 if (extensionEnabled(EXTDisjointTimerQueryName)) | |
2871 return getInt64Parameter(scriptState, GL_TIMESTAMP_EXT); | |
2872 return ScriptValue::createNull(scriptState); | |
Ken Russell (switch to Gerrit)
2015/09/04 01:17:09
This should generate an INVALID_ENUM error if the
David Yen
2015/09/04 16:04:41
Done.
| |
2873 case GL_GPU_DISJOINT_EXT: | |
2874 if (extensionEnabled(EXTDisjointTimerQueryName)) | |
2875 return getBooleanParameter(scriptState, GL_GPU_DISJOINT_EXT); | |
2876 return ScriptValue::createNull(scriptState); | |
Ken Russell (switch to Gerrit)
2015/09/04 01:17:09
Same thing here.
David Yen
2015/09/04 16:04:41
Done.
| |
2877 | |
2869 default: | 2878 default: |
2870 if ((extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) | 2879 if ((extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) |
2871 && pname >= GL_DRAW_BUFFER0_EXT | 2880 && pname >= GL_DRAW_BUFFER0_EXT |
2872 && pname < static_cast<GLenum>(GL_DRAW_BUFFER0_EXT + maxDrawBuffers( ))) { | 2881 && pname < static_cast<GLenum>(GL_DRAW_BUFFER0_EXT + maxDrawBuffers( ))) { |
2873 GLint value = GL_NONE; | 2882 GLint value = GL_NONE; |
2874 if (m_framebufferBinding) | 2883 if (m_framebufferBinding) |
2875 value = m_framebufferBinding->getDrawBuffer(pname); | 2884 value = m_framebufferBinding->getDrawBuffer(pname); |
2876 else // emulated backbuffer | 2885 else // emulated backbuffer |
2877 value = m_backDrawBuffer; | 2886 value = m_backDrawBuffer; |
2878 return WebGLAny(scriptState, value); | 2887 return WebGLAny(scriptState, value); |
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5161 } | 5170 } |
5162 | 5171 |
5163 ScriptValue WebGLRenderingContextBase::getIntParameter(ScriptState* scriptState, GLenum pname) | 5172 ScriptValue WebGLRenderingContextBase::getIntParameter(ScriptState* scriptState, GLenum pname) |
5164 { | 5173 { |
5165 GLint value = 0; | 5174 GLint value = 0; |
5166 if (!isContextLost()) | 5175 if (!isContextLost()) |
5167 webContext()->getIntegerv(pname, &value); | 5176 webContext()->getIntegerv(pname, &value); |
5168 return WebGLAny(scriptState, value); | 5177 return WebGLAny(scriptState, value); |
5169 } | 5178 } |
5170 | 5179 |
5180 ScriptValue WebGLRenderingContextBase::getInt64Parameter(ScriptState* scriptStat e, GLenum pname) | |
5181 { | |
5182 GLint64 value = 0; | |
5183 if (!isContextLost()) | |
5184 webContext()->getInteger64v(pname, &value); | |
5185 return WebGLAny(scriptState, value); | |
5186 } | |
5187 | |
5171 ScriptValue WebGLRenderingContextBase::getUnsignedIntParameter(ScriptState* scri ptState, GLenum pname) | 5188 ScriptValue WebGLRenderingContextBase::getUnsignedIntParameter(ScriptState* scri ptState, GLenum pname) |
5172 { | 5189 { |
5173 GLint value = 0; | 5190 GLint value = 0; |
5174 if (!isContextLost()) | 5191 if (!isContextLost()) |
5175 webContext()->getIntegerv(pname, &value); | 5192 webContext()->getIntegerv(pname, &value); |
5176 return WebGLAny(scriptState, static_cast<unsigned>(value)); | 5193 return WebGLAny(scriptState, static_cast<unsigned>(value)); |
5177 } | 5194 } |
5178 | 5195 |
5179 ScriptValue WebGLRenderingContextBase::getWebGLFloatArrayParameter(ScriptState* scriptState, GLenum pname) | 5196 ScriptValue WebGLRenderingContextBase::getWebGLFloatArrayParameter(ScriptState* scriptState, GLenum pname) |
5180 { | 5197 { |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6702 | 6719 |
6703 return totalBytesPerPixel; | 6720 return totalBytesPerPixel; |
6704 } | 6721 } |
6705 | 6722 |
6706 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6723 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6707 { | 6724 { |
6708 return m_drawingBuffer.get(); | 6725 return m_drawingBuffer.get(); |
6709 } | 6726 } |
6710 | 6727 |
6711 } // namespace blink | 6728 } // namespace blink |
OLD | NEW |