public class

RenderBuffer

extends Object
java.lang.Object
   ↳ sun.java2d.pipe.RenderBuffer

Class Overview

The RenderBuffer class is a simplified, high-performance, Unsafe wrapper used for buffering rendering operations in a single-threaded rendering environment. It's functionality is similar to the ByteBuffer and related NIO classes. However, the methods in this class perform little to no alignment or bounds checks for performance reasons. Therefore, it is the caller's responsibility to ensure that all put() calls are properly aligned and within bounds: - int and float values must be aligned on 4-byte boundaries - long and double values must be aligned on 8-byte boundaries This class only includes the bare minimum of methods to support single-threaded rendering. For example, there is no put(double[]) method because we currently have no need for such a method in the STR classes.

Summary

Constants
long SIZEOF_BYTE These constants represent the size of various data types (in bytes).
long SIZEOF_DOUBLE
long SIZEOF_FLOAT
long SIZEOF_INT
long SIZEOF_LONG
long SIZEOF_SHORT
Fields
protected final long baseAddress
protected final int capacity
protected long curAddress
protected final long endAddress
protected final Unsafe unsafe
Protected Constructors
RenderBuffer(int numBytes)
Public Methods
static RenderBuffer allocate(int numBytes)
Allocates a fresh buffer using the machine endianness.
final int capacity()
The behavior (and names) of the following methods are nearly identical to their counterparts in the various NIO Buffer classes.
final void clear()
final long getAddress()
Returns the base address of the underlying memory buffer.
final int position()
final void position(long numBytes)
RenderBuffer put(long[] x, int offset, int length)
RenderBuffer put(int[] x, int offset, int length)
RenderBuffer put(float[] x, int offset, int length)
RenderBuffer put(long[] x)
RenderBuffer put(int[] x)
RenderBuffer put(short[] x, int offset, int length)
RenderBuffer put(byte[] x, int offset, int length)
RenderBuffer put(short[] x)
RenderBuffer put(float[] x)
RenderBuffer put(byte[] x)
final RenderBuffer putByte(byte x)
putByte() methods...
final RenderBuffer putDouble(double x)
putDouble() method(s)...
final RenderBuffer putFloat(float x)
putFloat() methods...
final RenderBuffer putInt(int x)
final RenderBuffer putInt(int pos, int x)
putInt() methods...
final RenderBuffer putLong(long x)
putLong() methods...
final RenderBuffer putShort(short x)
putShort() methods...
final int remaining()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final long SIZEOF_BYTE

These constants represent the size of various data types (in bytes).

Constant Value: 1 (0x0000000000000001)

protected static final long SIZEOF_DOUBLE

Constant Value: 8 (0x0000000000000008)

protected static final long SIZEOF_FLOAT

Constant Value: 4 (0x0000000000000004)

protected static final long SIZEOF_INT

Constant Value: 4 (0x0000000000000004)

protected static final long SIZEOF_LONG

Constant Value: 8 (0x0000000000000008)

protected static final long SIZEOF_SHORT

Constant Value: 2 (0x0000000000000002)

Fields

protected final long baseAddress

protected final int capacity

protected long curAddress

protected final long endAddress

protected final Unsafe unsafe

Protected Constructors

protected RenderBuffer (int numBytes)

Public Methods

public static RenderBuffer allocate (int numBytes)

Allocates a fresh buffer using the machine endianness.

public final int capacity ()

The behavior (and names) of the following methods are nearly identical to their counterparts in the various NIO Buffer classes.

public final void clear ()

public final long getAddress ()

Returns the base address of the underlying memory buffer.

public final int position ()

public final void position (long numBytes)

public RenderBuffer put (long[] x, int offset, int length)

public RenderBuffer put (int[] x, int offset, int length)

public RenderBuffer put (float[] x, int offset, int length)

public RenderBuffer put (long[] x)

public RenderBuffer put (int[] x)

public RenderBuffer put (short[] x, int offset, int length)

public RenderBuffer put (byte[] x, int offset, int length)

public RenderBuffer put (short[] x)

public RenderBuffer put (float[] x)

public RenderBuffer put (byte[] x)

public final RenderBuffer putByte (byte x)

putByte() methods...

public final RenderBuffer putDouble (double x)

putDouble() method(s)...

public final RenderBuffer putFloat (float x)

putFloat() methods...

public final RenderBuffer putInt (int x)

public final RenderBuffer putInt (int pos, int x)

putInt() methods...

public final RenderBuffer putLong (long x)

putLong() methods...

public final RenderBuffer putShort (short x)

putShort() methods...

public final int remaining ()