| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 { | 205 { |
| 206 if (exec->argumentCount() < 1) | 206 if (exec->argumentCount() < 1) |
| 207 return throwSyntaxError(exec); | 207 return throwSyntaxError(exec); |
| 208 ExceptionCode ec = 0; | 208 ExceptionCode ec = 0; |
| 209 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl())
; | 209 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl())
; |
| 210 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !
exec->argument(0).inherits(&JSWebGLProgram::s_info)) | 210 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !
exec->argument(0).inherits(&JSWebGLProgram::s_info)) |
| 211 return throwTypeError(exec); | 211 return throwTypeError(exec); |
| 212 WebGLProgram* program = toWebGLProgram(exec->argument(0)); | 212 WebGLProgram* program = toWebGLProgram(exec->argument(0)); |
| 213 if (exec->hadException()) | 213 if (exec->hadException()) |
| 214 return jsNull(); | 214 return jsNull(); |
| 215 Vector<WebGLShader*> shaders; | 215 Vector<RefPtr<WebGLShader> > shaders; |
| 216 bool succeed = context->getAttachedShaders(program, shaders, ec); | 216 bool succeed = context->getAttachedShaders(program, shaders, ec); |
| 217 if (ec) { | 217 if (ec) { |
| 218 setDOMException(exec, ec); | 218 setDOMException(exec, ec); |
| 219 return jsNull(); | 219 return jsNull(); |
| 220 } | 220 } |
| 221 if (!succeed) | 221 if (!succeed) |
| 222 return jsNull(); | 222 return jsNull(); |
| 223 MarkedArgumentBuffer list; | 223 MarkedArgumentBuffer list; |
| 224 for (size_t ii = 0; ii < shaders.size(); ++ii) | 224 for (size_t ii = 0; ii < shaders.size(); ++ii) |
| 225 list.append(toJS(exec, globalObject(), shaders[ii])); | 225 list.append(toJS(exec, globalObject(), shaders[ii].get())); |
| 226 return constructArray(exec, globalObject(), list); | 226 return constructArray(exec, globalObject(), list); |
| 227 } | 227 } |
| 228 | 228 |
| 229 JSValue JSWebGLRenderingContext::getExtension(ExecState* exec) | 229 JSValue JSWebGLRenderingContext::getExtension(ExecState* exec) |
| 230 { | 230 { |
| 231 if (exec->argumentCount() < 1) | 231 if (exec->argumentCount() < 1) |
| 232 return throwSyntaxError(exec); | 232 return throwSyntaxError(exec); |
| 233 | 233 |
| 234 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl())
; | 234 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl())
; |
| 235 const String& name = ustringToString(exec->argument(0).toString(exec)); | 235 const String& name = ustringToString(exec->argument(0).toString(exec)); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 } | 708 } |
| 709 | 709 |
| 710 JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec) | 710 JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec) |
| 711 { | 711 { |
| 712 return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingConte
xt*>(impl())); | 712 return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingConte
xt*>(impl())); |
| 713 } | 713 } |
| 714 | 714 |
| 715 } // namespace WebCore | 715 } // namespace WebCore |
| 716 | 716 |
| 717 #endif // ENABLE(WEBGL) | 717 #endif // ENABLE(WEBGL) |
| OLD | NEW |