MCPcopy Index your code
hub / github.com/processing/processing / updateShortBuffer

Method updateShortBuffer

core/src/processing/opengl/PGL.java:2413–2435  ·  view source on GitHub ↗
(ShortBuffer buf, short[] arr,
                                                 boolean wrap)

Source from the content-addressed store, hash-verified

2411
2412
2413 protected static ShortBuffer updateShortBuffer(ShortBuffer buf, short[] arr,
2414 boolean wrap) {
2415 if (USE_DIRECT_BUFFERS) {
2416 if (buf == null || buf.capacity() < arr.length) {
2417 buf = allocateDirectShortBuffer(arr.length);
2418 }
2419 buf.position(0);
2420 buf.put(arr);
2421 buf.rewind();
2422 } else {
2423 if (wrap) {
2424 buf = ShortBuffer.wrap(arr);
2425 } else {
2426 if (buf == null || buf.capacity() < arr.length) {
2427 buf = ShortBuffer.allocate(arr.length);
2428 }
2429 buf.position(0);
2430 buf.put(arr);
2431 buf.rewind();
2432 }
2433 }
2434 return buf;
2435 }
2436
2437
2438 protected static void updateShortBuffer(ShortBuffer buf, short[] arr,

Callers 3

Calls 5

wrapMethod · 0.80
putMethod · 0.45
allocateMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected