T
- Type of the buffer.public class TripleBuffer<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TripleBuffer.ReadableBuffer<T>
Returned from
getReadableBuffer() . |
Constructor and Description |
---|
TripleBuffer() |
TripleBuffer(Supplier<T> factory)
Creates a triple buffer.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Free all buffers.
|
void |
doneWriting()
This method should be called by the painter thread, to signal that the rendering is completed.
|
void |
doneWriting(T value)
This method should be called by the painter thread, to submit a completed
buffer.
|
TripleBuffer.ReadableBuffer<T> |
getReadableBuffer()
This method should be called in the display thread.
|
T |
getWritableBuffer()
Returns a buffer that can be used in the painter thread for rendering.
|
public TripleBuffer(Supplier<T> factory)
factory
- Factory method, that is used to create the three buffers.public TripleBuffer()
public T getWritableBuffer()
submitted
buffer that is not used by the display thread anymore.null
.public void doneWriting()
getWritableBuffer()
public void doneWriting(T value)
getReadableBuffer()
(unless another doneWriting()
happens
in between).public TripleBuffer.ReadableBuffer<T> getReadableBuffer()
public void clear()
Copyright © 2015–2021 Fiji. All rights reserved.