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 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na
me, EXT_disjoint_timer_query not enabled"); |
| 2873 return ScriptValue::createNull(scriptState); |
| 2874 case GL_GPU_DISJOINT_EXT: |
| 2875 if (extensionEnabled(EXTDisjointTimerQueryName)) |
| 2876 return getBooleanParameter(scriptState, GL_GPU_DISJOINT_EXT); |
| 2877 synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter na
me, EXT_disjoint_timer_query not enabled"); |
| 2878 return ScriptValue::createNull(scriptState); |
| 2879 |
2869 default: | 2880 default: |
2870 if ((extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) | 2881 if ((extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher()) |
2871 && pname >= GL_DRAW_BUFFER0_EXT | 2882 && pname >= GL_DRAW_BUFFER0_EXT |
2872 && pname < static_cast<GLenum>(GL_DRAW_BUFFER0_EXT + maxDrawBuffers(
))) { | 2883 && pname < static_cast<GLenum>(GL_DRAW_BUFFER0_EXT + maxDrawBuffers(
))) { |
2873 GLint value = GL_NONE; | 2884 GLint value = GL_NONE; |
2874 if (m_framebufferBinding) | 2885 if (m_framebufferBinding) |
2875 value = m_framebufferBinding->getDrawBuffer(pname); | 2886 value = m_framebufferBinding->getDrawBuffer(pname); |
2876 else // emulated backbuffer | 2887 else // emulated backbuffer |
2877 value = m_backDrawBuffer; | 2888 value = m_backDrawBuffer; |
2878 return WebGLAny(scriptState, value); | 2889 return WebGLAny(scriptState, value); |
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5161 } | 5172 } |
5162 | 5173 |
5163 ScriptValue WebGLRenderingContextBase::getIntParameter(ScriptState* scriptState,
GLenum pname) | 5174 ScriptValue WebGLRenderingContextBase::getIntParameter(ScriptState* scriptState,
GLenum pname) |
5164 { | 5175 { |
5165 GLint value = 0; | 5176 GLint value = 0; |
5166 if (!isContextLost()) | 5177 if (!isContextLost()) |
5167 webContext()->getIntegerv(pname, &value); | 5178 webContext()->getIntegerv(pname, &value); |
5168 return WebGLAny(scriptState, value); | 5179 return WebGLAny(scriptState, value); |
5169 } | 5180 } |
5170 | 5181 |
| 5182 ScriptValue WebGLRenderingContextBase::getInt64Parameter(ScriptState* scriptStat
e, GLenum pname) |
| 5183 { |
| 5184 GLint64 value = 0; |
| 5185 if (!isContextLost()) |
| 5186 webContext()->getInteger64v(pname, &value); |
| 5187 return WebGLAny(scriptState, value); |
| 5188 } |
| 5189 |
5171 ScriptValue WebGLRenderingContextBase::getUnsignedIntParameter(ScriptState* scri
ptState, GLenum pname) | 5190 ScriptValue WebGLRenderingContextBase::getUnsignedIntParameter(ScriptState* scri
ptState, GLenum pname) |
5172 { | 5191 { |
5173 GLint value = 0; | 5192 GLint value = 0; |
5174 if (!isContextLost()) | 5193 if (!isContextLost()) |
5175 webContext()->getIntegerv(pname, &value); | 5194 webContext()->getIntegerv(pname, &value); |
5176 return WebGLAny(scriptState, static_cast<unsigned>(value)); | 5195 return WebGLAny(scriptState, static_cast<unsigned>(value)); |
5177 } | 5196 } |
5178 | 5197 |
5179 ScriptValue WebGLRenderingContextBase::getWebGLFloatArrayParameter(ScriptState*
scriptState, GLenum pname) | 5198 ScriptValue WebGLRenderingContextBase::getWebGLFloatArrayParameter(ScriptState*
scriptState, GLenum pname) |
5180 { | 5199 { |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6702 | 6721 |
6703 return totalBytesPerPixel; | 6722 return totalBytesPerPixel; |
6704 } | 6723 } |
6705 | 6724 |
6706 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const | 6725 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const |
6707 { | 6726 { |
6708 return m_drawingBuffer.get(); | 6727 return m_drawingBuffer.get(); |
6709 } | 6728 } |
6710 | 6729 |
6711 } // namespace blink | 6730 } // namespace blink |
OLD | NEW |