OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 case WebGLGetInfo::kTypeBool: | 127 case WebGLGetInfo::kTypeBool: |
128 return v8::Boolean::New(info.getBool()); | 128 return v8::Boolean::New(info.getBool()); |
129 case WebGLGetInfo::kTypeBoolArray: { | 129 case WebGLGetInfo::kTypeBoolArray: { |
130 const Vector<bool>& value = info.getBoolArray(); | 130 const Vector<bool>& value = info.getBoolArray(); |
131 v8::Local<v8::Array> array = v8::Array::New(value.size()); | 131 v8::Local<v8::Array> array = v8::Array::New(value.size()); |
132 for (size_t ii = 0; ii < value.size(); ++ii) | 132 for (size_t ii = 0; ii < value.size(); ++ii) |
133 array->Set(v8::Integer::New(ii, isolate), v8::Boolean::New(value[ii]
)); | 133 array->Set(v8::Integer::New(ii, isolate), v8::Boolean::New(value[ii]
)); |
134 return array; | 134 return array; |
135 } | 135 } |
136 case WebGLGetInfo::kTypeFloat: | 136 case WebGLGetInfo::kTypeFloat: |
137 return v8::Number::New(info.getFloat()); | 137 return v8::Number::New(isolate, info.getFloat()); |
138 case WebGLGetInfo::kTypeInt: | 138 case WebGLGetInfo::kTypeInt: |
139 return v8::Integer::New(info.getInt(), isolate); | 139 return v8::Integer::New(info.getInt(), isolate); |
140 case WebGLGetInfo::kTypeNull: | 140 case WebGLGetInfo::kTypeNull: |
141 return v8::Null(isolate); | 141 return v8::Null(isolate); |
142 case WebGLGetInfo::kTypeString: | 142 case WebGLGetInfo::kTypeString: |
143 return v8String(info.getString(), isolate); | 143 return v8String(info.getString(), isolate); |
144 case WebGLGetInfo::kTypeUnsignedInt: | 144 case WebGLGetInfo::kTypeUnsignedInt: |
145 return v8::Integer::NewFromUnsigned(info.getUnsignedInt(), isolate); | 145 return v8::Integer::NewFromUnsigned(info.getUnsignedInt(), isolate); |
146 case WebGLGetInfo::kTypeWebGLBuffer: | 146 case WebGLGetInfo::kTypeWebGLBuffer: |
147 return toV8(info.getWebGLBuffer(), creationContext, isolate); | 147 return toV8(info.getWebGLBuffer(), creationContext, isolate); |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 { | 761 { |
762 vertexAttribAndUniformHelperf(args, kVertexAttrib3v); | 762 vertexAttribAndUniformHelperf(args, kVertexAttrib3v); |
763 } | 763 } |
764 | 764 |
765 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& args) | 765 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& args) |
766 { | 766 { |
767 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); | 767 vertexAttribAndUniformHelperf(args, kVertexAttrib4v); |
768 } | 768 } |
769 | 769 |
770 } // namespace WebCore | 770 } // namespace WebCore |
OLD | NEW |