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

Method updateIntBuffer

core/src/processing/opengl/PGL.java:2505–2527  ·  view source on GitHub ↗
(IntBuffer buf, int[] arr,
                                             boolean wrap)

Source from the content-addressed store, hash-verified

2503
2504
2505 protected static IntBuffer updateIntBuffer(IntBuffer buf, int[] arr,
2506 boolean wrap) {
2507 if (USE_DIRECT_BUFFERS) {
2508 if (buf == null || buf.capacity() < arr.length) {
2509 buf = allocateDirectIntBuffer(arr.length);
2510 }
2511 buf.position(0);
2512 buf.put(arr);
2513 buf.rewind();
2514 } else {
2515 if (wrap) {
2516 buf = IntBuffer.wrap(arr);
2517 } else {
2518 if (buf == null || buf.capacity() < arr.length) {
2519 buf = IntBuffer.allocate(arr.length);
2520 }
2521 buf.position(0);
2522 buf.put(arr);
2523 buf.rewind();
2524 }
2525 }
2526 return buf;
2527 }
2528
2529
2530 protected static void updateIntBuffer(IntBuffer buf, int[] arr,

Callers 10

updateIntBufferMethod · 0.95
updateAttribBufferMethod · 0.95
updatePixelBufferMethod · 0.95
fillEdgesMethod · 0.95

Calls 5

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

Tested by

no test coverage detected