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

Side by Side Diff: Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp

Issue 7585017: Merge 92413 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 template<typename T, size_t inlineCapacity> 381 template<typename T, size_t inlineCapacity>
382 bool toVector(JSC::ExecState* exec, JSC::JSValue value, Vector<T, inlineCapacity >& vector) 382 bool toVector(JSC::ExecState* exec, JSC::JSValue value, Vector<T, inlineCapacity >& vector)
383 { 383 {
384 if (!value.isObject()) 384 if (!value.isObject())
385 return false; 385 return false;
386 386
387 JSC::JSObject* object = asObject(value); 387 JSC::JSObject* object = asObject(value);
388 int32_t length = object->get(exec, JSC::Identifier(exec, "length")).toInt32( exec); 388 int32_t length = object->get(exec, JSC::Identifier(exec, "length")).toInt32( exec);
389
390 if (!vector.tryReserveCapacity(length))
391 return false;
389 vector.resize(length); 392 vector.resize(length);
390 393
391 for (int32_t i = 0; i < length; ++i) { 394 for (int32_t i = 0; i < length; ++i) {
392 JSC::JSValue v = object->get(exec, i); 395 JSC::JSValue v = object->get(exec, i);
393 if (exec->hadException()) 396 if (exec->hadException())
394 return false; 397 return false;
395 vector[i] = static_cast<T>(v.toNumber(exec)); 398 vector[i] = static_cast<T>(v.toNumber(exec));
396 } 399 }
397 400
398 return true; 401 return true;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 } 708 }
706 709
707 JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec) 710 JSC::JSValue JSWebGLRenderingContext::vertexAttrib4fv(JSC::ExecState* exec)
708 { 711 {
709 return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingConte xt*>(impl())); 712 return dataFunctionf(f_vertexAttrib4v, exec, static_cast<WebGLRenderingConte xt*>(impl()));
710 } 713 }
711 714
712 } // namespace WebCore 715 } // namespace WebCore
713 716
714 #endif // ENABLE(WEBGL) 717 #endif // ENABLE(WEBGL)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698