Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1826283004: Revert NotImplemented() changes in r383029 and r383047. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "modules/webgl/WebGLLoseContext.h" 79 #include "modules/webgl/WebGLLoseContext.h"
80 #include "modules/webgl/WebGLProgram.h" 80 #include "modules/webgl/WebGLProgram.h"
81 #include "modules/webgl/WebGLRenderbuffer.h" 81 #include "modules/webgl/WebGLRenderbuffer.h"
82 #include "modules/webgl/WebGLShader.h" 82 #include "modules/webgl/WebGLShader.h"
83 #include "modules/webgl/WebGLShaderPrecisionFormat.h" 83 #include "modules/webgl/WebGLShaderPrecisionFormat.h"
84 #include "modules/webgl/WebGLTexture.h" 84 #include "modules/webgl/WebGLTexture.h"
85 #include "modules/webgl/WebGLUniformLocation.h" 85 #include "modules/webgl/WebGLUniformLocation.h"
86 #include "modules/webgl/WebGLVertexArrayObject.h" 86 #include "modules/webgl/WebGLVertexArrayObject.h"
87 #include "modules/webgl/WebGLVertexArrayObjectOES.h" 87 #include "modules/webgl/WebGLVertexArrayObjectOES.h"
88 #include "platform/CheckedInt.h" 88 #include "platform/CheckedInt.h"
89 #include "platform/NotImplemented.h"
89 #include "platform/RuntimeEnabledFeatures.h" 90 #include "platform/RuntimeEnabledFeatures.h"
90 #include "platform/geometry/IntSize.h" 91 #include "platform/geometry/IntSize.h"
91 #include "platform/graphics/GraphicsContext.h" 92 #include "platform/graphics/GraphicsContext.h"
92 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 93 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
93 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h" 94 #include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
94 #include "platform/graphics/gpu/DrawingBuffer.h" 95 #include "platform/graphics/gpu/DrawingBuffer.h"
95 #include "public/platform/Platform.h" 96 #include "public/platform/Platform.h"
96 #include "public/platform/WebGraphicsContext3D.h" 97 #include "public/platform/WebGraphicsContext3D.h"
97 #include "public/platform/WebGraphicsContext3DProvider.h" 98 #include "public/platform/WebGraphicsContext3DProvider.h"
98 #include "wtf/ArrayBufferContents.h" 99 #include "wtf/ArrayBufferContents.h"
(...skipping 3108 matching lines...) Expand 10 before | Expand all | Expand 10 after
3207 contextGL()->GetUniformiv(objectOrZero(program), location, v alue); 3208 contextGL()->GetUniformiv(objectOrZero(program), location, v alue);
3208 if (length > 1) { 3209 if (length > 1) {
3209 bool boolValue[16] = {0}; 3210 bool boolValue[16] = {0};
3210 for (unsigned j = 0; j < length; j++) 3211 for (unsigned j = 0; j < length; j++)
3211 boolValue[j] = static_cast<bool>(value[j]); 3212 boolValue[j] = static_cast<bool>(value[j]);
3212 return WebGLAny(scriptState, boolValue, length); 3213 return WebGLAny(scriptState, boolValue, length);
3213 } 3214 }
3214 return WebGLAny(scriptState, static_cast<bool>(value[0])); 3215 return WebGLAny(scriptState, static_cast<bool>(value[0]));
3215 } 3216 }
3216 default: 3217 default:
3217 NOTIMPLEMENTED(); 3218 notImplemented();
3218 } 3219 }
3219 } 3220 }
3220 } 3221 }
3221 } 3222 }
3222 // If we get here, something went wrong in our unfortunately complex logic a bove 3223 // If we get here, something went wrong in our unfortunately complex logic a bove
3223 synthesizeGLError(GL_INVALID_VALUE, "getUniform", "unknown error"); 3224 synthesizeGLError(GL_INVALID_VALUE, "getUniform", "unknown error");
3224 return ScriptValue::createNull(scriptState); 3225 return ScriptValue::createNull(scriptState);
3225 } 3226 }
3226 3227
3227 WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation(WebGLProgram * program, const String& name) 3228 WebGLUniformLocation* WebGLRenderingContextBase::getUniformLocation(WebGLProgram * program, const String& name)
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after
5169 { 5170 {
5170 GLboolean value = 0; 5171 GLboolean value = 0;
5171 if (!isContextLost()) 5172 if (!isContextLost())
5172 contextGL()->GetBooleanv(pname, &value); 5173 contextGL()->GetBooleanv(pname, &value);
5173 return WebGLAny(scriptState, static_cast<bool>(value)); 5174 return WebGLAny(scriptState, static_cast<bool>(value));
5174 } 5175 }
5175 5176
5176 ScriptValue WebGLRenderingContextBase::getBooleanArrayParameter(ScriptState* scr iptState, GLenum pname) 5177 ScriptValue WebGLRenderingContextBase::getBooleanArrayParameter(ScriptState* scr iptState, GLenum pname)
5177 { 5178 {
5178 if (pname != GL_COLOR_WRITEMASK) { 5179 if (pname != GL_COLOR_WRITEMASK) {
5179 NOTIMPLEMENTED(); 5180 notImplemented();
5180 return WebGLAny(scriptState, 0, 0); 5181 return WebGLAny(scriptState, 0, 0);
5181 } 5182 }
5182 GLboolean value[4] = {0}; 5183 GLboolean value[4] = {0};
5183 if (!isContextLost()) 5184 if (!isContextLost())
5184 contextGL()->GetBooleanv(pname, value); 5185 contextGL()->GetBooleanv(pname, value);
5185 bool boolValue[4]; 5186 bool boolValue[4];
5186 for (int ii = 0; ii < 4; ++ii) 5187 for (int ii = 0; ii < 4; ++ii)
5187 boolValue[ii] = static_cast<bool>(value[ii]); 5188 boolValue[ii] = static_cast<bool>(value[ii]);
5188 return WebGLAny(scriptState, boolValue, 4); 5189 return WebGLAny(scriptState, boolValue, 4);
5189 } 5190 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
5230 case GL_ALIASED_POINT_SIZE_RANGE: 5231 case GL_ALIASED_POINT_SIZE_RANGE:
5231 case GL_ALIASED_LINE_WIDTH_RANGE: 5232 case GL_ALIASED_LINE_WIDTH_RANGE:
5232 case GL_DEPTH_RANGE: 5233 case GL_DEPTH_RANGE:
5233 length = 2; 5234 length = 2;
5234 break; 5235 break;
5235 case GL_BLEND_COLOR: 5236 case GL_BLEND_COLOR:
5236 case GL_COLOR_CLEAR_VALUE: 5237 case GL_COLOR_CLEAR_VALUE:
5237 length = 4; 5238 length = 4;
5238 break; 5239 break;
5239 default: 5240 default:
5240 NOTIMPLEMENTED(); 5241 notImplemented();
5241 } 5242 }
5242 return WebGLAny(scriptState, DOMFloat32Array::create(value, length)); 5243 return WebGLAny(scriptState, DOMFloat32Array::create(value, length));
5243 } 5244 }
5244 5245
5245 ScriptValue WebGLRenderingContextBase::getWebGLIntArrayParameter(ScriptState* sc riptState, GLenum pname) 5246 ScriptValue WebGLRenderingContextBase::getWebGLIntArrayParameter(ScriptState* sc riptState, GLenum pname)
5246 { 5247 {
5247 GLint value[4] = {0}; 5248 GLint value[4] = {0};
5248 if (!isContextLost()) 5249 if (!isContextLost())
5249 contextGL()->GetIntegerv(pname, value); 5250 contextGL()->GetIntegerv(pname, value);
5250 unsigned length = 0; 5251 unsigned length = 0;
5251 switch (pname) { 5252 switch (pname) {
5252 case GL_MAX_VIEWPORT_DIMS: 5253 case GL_MAX_VIEWPORT_DIMS:
5253 length = 2; 5254 length = 2;
5254 break; 5255 break;
5255 case GL_SCISSOR_BOX: 5256 case GL_SCISSOR_BOX:
5256 case GL_VIEWPORT: 5257 case GL_VIEWPORT:
5257 length = 4; 5258 length = 4;
5258 break; 5259 break;
5259 default: 5260 default:
5260 NOTIMPLEMENTED(); 5261 notImplemented();
5261 } 5262 }
5262 return WebGLAny(scriptState, DOMInt32Array::create(value, length)); 5263 return WebGLAny(scriptState, DOMInt32Array::create(value, length));
5263 } 5264 }
5264 5265
5265 WebGLTexture* WebGLRenderingContextBase::validateTexture2DBinding(const char* fu nctionName, GLenum target) 5266 WebGLTexture* WebGLRenderingContextBase::validateTexture2DBinding(const char* fu nctionName, GLenum target)
5266 { 5267 {
5267 WebGLTexture* tex = nullptr; 5268 WebGLTexture* tex = nullptr;
5268 switch (target) { 5269 switch (target) {
5269 case GL_TEXTURE_2D: 5270 case GL_TEXTURE_2D:
5270 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get(); 5271 tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get();
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
6333 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6334 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6334 } 6335 }
6335 6336
6336 void WebGLRenderingContextBase::restoreUnpackParameters() 6337 void WebGLRenderingContextBase::restoreUnpackParameters()
6337 { 6338 {
6338 if (m_unpackAlignment != 1) 6339 if (m_unpackAlignment != 1)
6339 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6340 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6340 } 6341 }
6341 6342
6342 } // namespace blink 6343 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp ('k') | third_party/WebKit/Source/platform/Logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698