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

Method copyBufferFromSource

core/src/processing/opengl/Texture.java:815–832  ·  view source on GitHub ↗
(Object natRef, ByteBuffer byteBuf,
                                   int w, int h)

Source from the content-addressed store, hash-verified

813
814
815 public void copyBufferFromSource(Object natRef, ByteBuffer byteBuf,
816 int w, int h) {
817 if (bufferCache == null) {
818 bufferCache = new LinkedList<BufferData>();
819 }
820
821 if (bufferCache.size() + 1 <= MAX_BUFFER_CACHE_SIZE) {
822 bufferCache.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
823 } else {
824 // The buffer cache reached the maximum size, so we just dispose
825 // the new buffer by adding it to the list of used buffers.
826 try {
827 usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
828 } catch (Exception e) {
829 e.printStackTrace();
830 }
831 }
832 }
833
834
835 public void disposeSourceBuffer() {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
addMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected