|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.compositor.Compositor
public class Compositor
Handles the process of compositing the view from its various elements.
| Nested Class Summary | |
|---|---|
static class |
Compositor.State
Represents the saved state of the compositor. |
| Field Summary | |
|---|---|
protected Color4f |
_backgroundColor
The current background color, or null to use the default. |
protected Map<RenderEffectConfig,SoftReference<RenderEffect>> |
_cachedEffects
Cached render effects. |
protected Camera |
_camera
The camera. |
protected List<RenderEffect> |
_combinedEffects
The combined list of render effects. |
protected GlContext |
_ctx
The application context. |
protected Color4f |
_defaultBackgroundColor
The default background color. |
protected Map<Dependency,Dependency> |
_dependencies
The current set of dependencies. |
protected List<RenderEffect> |
_effects
The non-dependency render effects. |
protected List<Enqueueable> |
_enqueueables
The current set of enqueueables. |
protected RenderQueue.Group |
_group
The base render queue group. |
protected List<Compositable> |
_roots
The roots of the view. |
protected boolean |
_skipColorClear
When set, indicates that we need not clear the color buffer. |
protected List<SoftReference<Compositor.State>> |
_statePool
A pool of state objects to reuse. |
protected int |
_subrenderDepth
The current subrender depth. |
protected Object |
_subrenderSource
The source of the current subrender operation. |
| Constructor Summary | |
|---|---|
Compositor(GlContext ctx)
Creates a new compositor. |
|
| Method Summary | |
|---|---|
void |
addDependency(Dependency dependency)
Adds an element to the set of render dependencies. |
void |
addDependencyEffect(RenderEffectConfig config)
Adds an effect associated with a dependency. |
void |
addEffect(RenderEffect effect)
Adds an effect to apply. |
void |
addEnqueueable(Enqueueable enqueueable)
Adds an element to the list of render enqueueables. |
void |
addEnqueueable(Enqueueable enqueueable,
int maxSubrenderDepth)
Adds an element to the list of render enqueueables if the subrender depth is at or below the specified value. |
void |
addRoot(Compositable root)
Adds an element to the list of view roots. |
void |
cleanupSubrender(Compositor.State ostate)
Cleans up after the subrender operations. |
void |
clearDependencies()
Cleans up and clears the current set of dependencies. |
void |
enqueueEnqueueables()
Enqueues and clears the current list of enqueueables. |
Color4f |
getBackgroundColor()
Returns the background color reference. |
Camera |
getCamera()
Returns a reference to the camera. |
Color4f |
getDefaultBackgroundColor()
Returns a reference to the default background color. |
Map<Dependency,Dependency> |
getDependencies()
Returns a reference to the dependency map. |
RenderQueue.Group |
getGroup()
Returns a reference to the base render queue group. |
RenderQueue |
getQueue(String name)
Retrieves a reference to a render queue. |
protected Compositor.State |
getStateFromPool()
Retrieves a state object from the shared pool. |
int |
getSubrenderDepth()
Returns the currently number of subrender levels. |
Object |
getSubrenderSource()
Returns a reference to the source of the current subrender operation. |
void |
performSubrender(Object source)
Performs a subrender operation. |
Compositor.State |
prepareSubrender()
Prepates for one or more subrender operations. |
void |
removeEffect(RenderEffect effect)
Removes an effect. |
void |
removeRoot(Compositable root)
Removes an element from the list of view roots. |
void |
renderPrevious(int idx)
For the specified index within the list of combined effects, renders the previous contents. |
protected void |
renderQueues(int minPriority,
int maxPriority)
Renders the contents of the queues within the specified priority range. |
void |
renderView()
Renders the composited view. |
void |
resetQueues()
Resets the list of render queues. |
void |
setBackgroundColor(Color4f color)
Sets the background color reference. |
void |
setCamera(Camera camera)
Sets the camera reference. |
void |
setDependencies(Map<Dependency,Dependency> dependencies)
Sets the dependency map reference. |
void |
setSkipColorClear()
Sets the flag indicating that we need not clear the color buffer before rendering the frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GlContext _ctx
protected Camera _camera
protected Color4f _defaultBackgroundColor
protected Color4f _backgroundColor
null to use the default.
protected List<Compositable> _roots
protected List<RenderEffect> _effects
protected Map<Dependency,Dependency> _dependencies
protected List<Enqueueable> _enqueueables
protected List<RenderEffect> _combinedEffects
protected boolean _skipColorClear
protected RenderQueue.Group _group
protected int _subrenderDepth
protected Object _subrenderSource
protected Map<RenderEffectConfig,SoftReference<RenderEffect>> _cachedEffects
protected List<SoftReference<Compositor.State>> _statePool
| Constructor Detail |
|---|
public Compositor(GlContext ctx)
| Method Detail |
|---|
public void setCamera(Camera camera)
public Camera getCamera()
public Color4f getDefaultBackgroundColor()
public void setBackgroundColor(Color4f color)
color - the background color, or null to use the default.public Color4f getBackgroundColor()
public void addRoot(Compositable root)
public void removeRoot(Compositable root)
public void addEffect(RenderEffect effect)
public void removeEffect(RenderEffect effect)
public void renderView()
public Compositor.State prepareSubrender()
public void performSubrender(Object source)
source - the source of the subrender operation.public void cleanupSubrender(Compositor.State ostate)
ostate - the state to restore.public int getSubrenderDepth()
public Object getSubrenderSource()
public void addDependency(Dependency dependency)
public void clearDependencies()
public void setDependencies(Map<Dependency,Dependency> dependencies)
public Map<Dependency,Dependency> getDependencies()
public void addEnqueueable(Enqueueable enqueueable)
public void addEnqueueable(Enqueueable enqueueable,
int maxSubrenderDepth)
public void enqueueEnqueueables()
public void setSkipColorClear()
public void addDependencyEffect(RenderEffectConfig config)
public void renderPrevious(int idx)
public RenderQueue getQueue(String name)
public void resetQueues()
public RenderQueue.Group getGroup()
protected void renderQueues(int minPriority,
int maxPriority)
protected Compositor.State getStateFromPool()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||