MCPcopy Index your code
hub / github.com/benfry/processing4 / updateIntBuffer

Method updateIntBuffer

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

Source from the content-addressed store, hash-verified

2561
2562
2563 protected static IntBuffer updateIntBuffer(IntBuffer buf, int[] arr,
2564 boolean wrap) {
2565 if (USE_DIRECT_BUFFERS || (buf != null && buf.isDirect())) {
2566 if (buf == null || buf.capacity() < arr.length) {
2567 buf = allocateDirectIntBuffer(arr.length);
2568 }
2569 buf.position(0);
2570 buf.put(arr);
2571 buf.rewind();
2572 } else {
2573 if (wrap) {
2574 buf = IntBuffer.wrap(arr);
2575 } else {
2576 if (buf == null || buf.capacity() < arr.length) {
2577 buf = IntBuffer.allocate(arr.length);
2578 }
2579 buf.position(0);
2580 buf.put(arr);
2581 buf.rewind();
2582 }
2583 }
2584 return buf;
2585 }
2586
2587
2588 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