| Modifier and Type | Field and Description |
|---|---|
| protected RenderBuffer | buf
The underlying buffer for this queue. |
| private static final int | BUFFER_SIZE
The size of the underlying buffer, in bytes. |
| protected Set | refSet
A Set containing hard references to Objects that must stay alive until the queue has been completely flushed. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | addReference(Object ref)
Adds the given Object to the set of hard references, which will prevent that Object from being disposed until the queue has been flushed completely. |
| public final void | ensureAlignment(int
offset (in bytes) from the current
position to the first 8-byte value used in the following operation first8ByteValueOffset)Inserts a 4-byte NOOP token when necessary to ensure that all 8-byte parameters for the following operation are added to the underlying buffer with an 8-byte memory alignment. |
| public final void | ensureCapacity(int
size (in bytes) of the following operation opsize)Ensures that there will be enough room on the underlying buffer for the following operation. |
| public final void | ensureCapacityAndAlignment(int
size (in bytes) of the following operation opsize, int offset (in bytes) from the current
position to the first 8-byte value used in the following operation first8ByteValueOffset)Convenience method that is equivalent to calling ensureCapacity() followed by ensureAlignment(). |
| public abstract void | flushAndInvokeNow(Runnable task)
Immediately processes each operation currently pending on the buffer, and then invokes the provided task. |
| public abstract void | |
| public void | flushNow(int position)
Updates the current position of the underlying buffer, and then flushes the queue immediately. |
| public final RenderBuffer | |
| public final void | |
| public final boolean | |
| public final void |
| buf | back to summary |
|---|---|
| protected RenderBuffer buf The underlying buffer for this queue. | |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE The size of the underlying buffer, in bytes. | |
| refSet | back to summary |
|---|---|
| protected Set<Object> refSet A Set containing hard references to Objects that must stay alive until the queue has been completely flushed. | |
| RenderQueue | back to summary |
|---|---|
| protected RenderQueue() | |
| addReference | back to summary |
|---|---|
| public final void addReference(Object ref) Adds the given Object to the set of hard references, which will prevent that Object from being disposed until the queue has been flushed completely. This is useful in cases where some enqueued data could become invalid if the reference Object were garbage collected before the queue could be processed. (For example, keeping a hard reference to a FontStrike will prevent any enqueued glyph images associated with that strike from becoming invalid before the queue is flushed.) The reference set will be cleared immediately after the queue is flushed each time. | |
| ensureAlignment | back to summary |
|---|---|
| public final void ensureAlignment(int first8ByteValueOffset) Inserts a 4-byte NOOP token when necessary to ensure that all 8-byte parameters for the following operation are added to the underlying buffer with an 8-byte memory alignment.
| |
| ensureCapacity | back to summary |
|---|---|
| public final void ensureCapacity(int opsize) Ensures that there will be enough room on the underlying buffer for the following operation. If the operation will not fit given the remaining space, the buffer will be flushed immediately, leaving an empty buffer for the impending operation.
| |
| ensureCapacityAndAlignment | back to summary |
|---|---|
| public final void ensureCapacityAndAlignment(int opsize, int first8ByteValueOffset) Convenience method that is equivalent to calling ensureCapacity() followed by ensureAlignment(). The ensureCapacity() call allows for an extra 4 bytes of space in case the ensureAlignment() method needs to insert a NOOP token on the buffer.
| |
| flushAndInvokeNow | back to summary |
|---|---|
| public abstract void flushAndInvokeNow(Runnable task) Immediately processes each operation currently pending on the buffer, and then invokes the provided task. This method will block until the entire buffer has been flushed and the provided task has been executed. The queue lock must be acquired before calling this method. | |
| flushNow | back to summary |
|---|---|
| public abstract void flushNow() Immediately processes each operation currently pending on the buffer. This method will block until the entire buffer has been flushed. The queue lock must be acquired before calling this method. | |
| flushNow | back to summary |
|---|---|
| public void flushNow(int position) Updates the current position of the underlying buffer, and then flushes the queue immediately. This method is useful when native code has added data to the queue and needs to flush immediately. | |
| getBuffer | back to summary |
|---|---|
| public final RenderBuffer getBuffer() Returns the encapsulated RenderBuffer object. | |
| lock | back to summary |
|---|---|
| public final void lock() Locks the queue for read/write access. | |
| tryLock | back to summary |
|---|---|
| public final boolean tryLock() Attempts to lock the queue. If successful, this method returns true,
indicating that the caller is responsible for calling
| |
| unlock | back to summary |
|---|---|
| public final void unlock() Unlocks the queue. | |