| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "bindings/core/v8/custom/V8Int8ArrayCustom.h" | 74 #include "bindings/core/v8/custom/V8Int8ArrayCustom.h" |
| 75 #include "bindings/core/v8/custom/V8Uint16ArrayCustom.h" | 75 #include "bindings/core/v8/custom/V8Uint16ArrayCustom.h" |
| 76 #include "bindings/core/v8/custom/V8Uint32ArrayCustom.h" | 76 #include "bindings/core/v8/custom/V8Uint32ArrayCustom.h" |
| 77 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" | 77 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" |
| 78 #include "core/dom/ExceptionCode.h" | 78 #include "core/dom/ExceptionCode.h" |
| 79 #include "core/html/canvas/WebGLRenderingContext.h" | 79 #include "core/html/canvas/WebGLRenderingContext.h" |
| 80 #include "platform/NotImplemented.h" | 80 #include "platform/NotImplemented.h" |
| 81 #include "wtf/FastMalloc.h" | 81 #include "wtf/FastMalloc.h" |
| 82 #include <limits> | 82 #include <limits> |
| 83 | 83 |
| 84 namespace WebCore { | 84 namespace blink { |
| 85 | 85 |
| 86 // Allocates new storage via fastMalloc. | 86 // Allocates new storage via fastMalloc. |
| 87 // Returns 0 if array failed to convert for any reason. | 87 // Returns 0 if array failed to convert for any reason. |
| 88 static float* jsArrayToFloatArray(v8::Handle<v8::Array> array, uint32_t len, Exc
eptionState& exceptionState) | 88 static float* jsArrayToFloatArray(v8::Handle<v8::Array> array, uint32_t len, Exc
eptionState& exceptionState) |
| 89 { | 89 { |
| 90 // Convert the data element-by-element. | 90 // Convert the data element-by-element. |
| 91 if (len > std::numeric_limits<uint32_t>::max() / sizeof(float)) { | 91 if (len > std::numeric_limits<uint32_t>::max() / sizeof(float)) { |
| 92 exceptionState.throwTypeError("Array length exceeds supported limit."); | 92 exceptionState.throwTypeError("Array length exceeds supported limit."); |
| 93 return 0; | 93 return 0; |
| 94 } | 94 } |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b3fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 821 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b3fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
| 822 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); | 822 vertexAttribAndUniformHelperf(info, kVertexAttrib3v, exceptionState); |
| 823 } | 823 } |
| 824 | 824 |
| 825 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 825 void V8WebGLRenderingContext::vertexAttrib4fvMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 826 { | 826 { |
| 827 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); | 827 ExceptionState exceptionState(ExceptionState::ExecutionContext, "vertexAttri
b4fv", "WebGLRenderingContext", info.Holder(), info.GetIsolate()); |
| 828 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); | 828 vertexAttribAndUniformHelperf(info, kVertexAttrib4v, exceptionState); |
| 829 } | 829 } |
| 830 | 830 |
| 831 } // namespace WebCore | 831 } // namespace blink |
| OLD | NEW |