()
| 894 | |
| 895 | |
| 896 | protected boolean bufferUpdate() { |
| 897 | BufferData data = null; |
| 898 | try { |
| 899 | data = bufferCache.remove(0); |
| 900 | } catch (NoSuchElementException ex) { |
| 901 | PGraphics.showWarning("Don't have pixel data to copy to texture"); |
| 902 | } |
| 903 | |
| 904 | if (data != null) { |
| 905 | if ((data.w != width) || (data.h != height)) { |
| 906 | init(data.w, data.h); |
| 907 | } |
| 908 | data.rgbBuf.rewind(); |
| 909 | setNative(data.rgbBuf, 0, 0, width, height); |
| 910 | |
| 911 | // Putting the buffer in the used buffers list to dispose at the end of |
| 912 | // draw. |
| 913 | if (usedBuffers == null) { |
| 914 | usedBuffers = new LinkedList<BufferData>(); |
| 915 | } |
| 916 | usedBuffers.add(data); |
| 917 | |
| 918 | return true; |
| 919 | } else { |
| 920 | return false; |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | |
| 925 | protected void getSourceMethods() { |
no test coverage detected