LibreOffice Module android (master) 1
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
org.mozilla.gecko.gfx.Layer Class Referenceabstract
Inheritance diagram for org.mozilla.gecko.gfx.Layer:
[legend]
Collaboration diagram for org.mozilla.gecko.gfx.Layer:
[legend]

Classes

class  RenderContext
 

Public Member Functions

 Layer ()
 
 Layer (IntSize size)
 
final boolean update (RenderContext context)
 Updates the layer. More...
 
abstract void draw (RenderContext context)
 Subclasses override this function to draw the layer. More...
 
Region getValidRegion (RenderContext context)
 Returns the region of the layer that is considered valid. More...
 
void beginTransaction ()
 Call this before modifying the layer. More...
 
void endTransaction ()
 Call this when you're done modifying the layer. More...
 
Rect getPosition ()
 Returns the current layer position. More...
 
void setPosition (Rect newPosition)
 Sets the position. More...
 
float getResolution ()
 Returns the current layer's resolution. More...
 
void setResolution (float newResolution)
 Sets the layer resolution. More...
 
boolean usesDefaultProgram ()
 

Protected Member Functions

RectF getBounds (RenderContext context)
 Given the intrinsic size of the layer, returns the pixel boundaries of the layer rect. More...
 
boolean inTransaction ()
 Returns true if the layer is currently in a transaction and false otherwise. More...
 
void performUpdates (RenderContext context)
 Subclasses may override this method to perform custom layer updates. More...
 
final void fillRectCoordBuffer (float[] dest, RectF rect, float viewWidth, float viewHeight, Rect cropRect, float texWidth, float texHeight)
 This function fills in the provided dest array with values to render a texture. More...
 

Protected Attributes

Rect mPosition
 
float mResolution
 
boolean mUsesDefaultProgram = true
 

Private Attributes

final ReentrantLock mTransactionLock
 
boolean mInTransaction
 
Rect mNewPosition
 
float mNewResolution
 

Detailed Description

Definition at line 17 of file Layer.java.

Constructor & Destructor Documentation

◆ Layer() [1/2]

org.mozilla.gecko.gfx.Layer.Layer ( )
inline

Definition at line 27 of file Layer.java.

◆ Layer() [2/2]

org.mozilla.gecko.gfx.Layer.Layer ( IntSize  size)
inline

Member Function Documentation

◆ beginTransaction()

void org.mozilla.gecko.gfx.Layer.beginTransaction ( )
inline

Call this before modifying the layer.

Note that, for TileLayers, "modifying the layer" includes altering the underlying CairoImage in any way. Thus you must call this function before modifying the byte buffer associated with this layer.

This function may block, so you should never call this on the main UI thread.

Reimplemented in org.mozilla.gecko.gfx.ComposedTileLayer.

Definition at line 87 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mInTransaction, org.mozilla.gecko.gfx.Layer.mNewResolution, org.mozilla.gecko.gfx.Layer.mResolution, and org.mozilla.gecko.gfx.Layer.mTransactionLock.

Referenced by org.mozilla.gecko.gfx.ComposedTileLayer.createNewTile(), org.mozilla.gecko.gfx.ScrollbarLayer.fade(), and org.mozilla.gecko.gfx.ScrollbarLayer.unfade().

◆ draw()

abstract void org.mozilla.gecko.gfx.Layer.draw ( RenderContext  context)
abstract

◆ endTransaction()

void org.mozilla.gecko.gfx.Layer.endTransaction ( )
inline

◆ fillRectCoordBuffer()

final void org.mozilla.gecko.gfx.Layer.fillRectCoordBuffer ( float[]  dest,
RectF  rect,
float  viewWidth,
float  viewHeight,
Rect  cropRect,
float  texWidth,
float  texHeight 
)
inlineprotected

This function fills in the provided dest array with values to render a texture.

The array is filled with 4 sets of {x, y, z, texture_x, texture_y} values (so 20 values in total) corresponding to the corners of the rect.

Definition at line 162 of file Layer.java.

Referenced by org.mozilla.gecko.gfx.SingleTileLayer.draw(), and org.mozilla.gecko.gfx.SubTile.draw().

◆ getBounds()

RectF org.mozilla.gecko.gfx.Layer.getBounds ( RenderContext  context)
inlineprotected

◆ getPosition()

Rect org.mozilla.gecko.gfx.Layer.getPosition ( )
inline

Returns the current layer position.

Definition at line 109 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mPosition, and Rect.

◆ getResolution()

float org.mozilla.gecko.gfx.Layer.getResolution ( )
inline

Returns the current layer's resolution.

Definition at line 121 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mResolution.

◆ getValidRegion()

Region org.mozilla.gecko.gfx.Layer.getValidRegion ( RenderContext  context)
inline

Returns the region of the layer that is considered valid.

The default implementation of this will return the bounds of the layer, but this may be overridden.

Reimplemented in org.mozilla.gecko.gfx.ComposedTileLayer.

Definition at line 76 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.getBounds(), and org.mozilla.gecko.gfx.RectUtils.round().

◆ inTransaction()

boolean org.mozilla.gecko.gfx.Layer.inTransaction ( )
inlineprotected

Returns true if the layer is currently in a transaction and false otherwise.

Definition at line 104 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mInTransaction.

Referenced by org.mozilla.gecko.gfx.SubTile.invalidate(), and org.mozilla.gecko.gfx.TileLayer.invalidate().

◆ performUpdates()

void org.mozilla.gecko.gfx.Layer.performUpdates ( RenderContext  context)
inlineprotected

Subclasses may override this method to perform custom layer updates.

This will be called with the transaction lock held. Subclass implementations of this method must call the superclass implementation. Returns false if there is still work to be done after this update is complete.

Reimplemented in org.mozilla.gecko.gfx.ComposedTileLayer, org.mozilla.gecko.gfx.SubTile, and org.mozilla.gecko.gfx.TileLayer.

Definition at line 146 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mNewPosition, org.mozilla.gecko.gfx.Layer.mNewResolution, org.mozilla.gecko.gfx.Layer.mPosition, and org.mozilla.gecko.gfx.Layer.mResolution.

Referenced by org.mozilla.gecko.gfx.Layer.update().

◆ setPosition()

void org.mozilla.gecko.gfx.Layer.setPosition ( Rect  newPosition)
inline

Sets the position.

Only valid inside a transaction.

Definition at line 114 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mInTransaction, and org.mozilla.gecko.gfx.Layer.mNewPosition.

Referenced by org.mozilla.gecko.gfx.SubTile.refreshTileMetrics().

◆ setResolution()

void org.mozilla.gecko.gfx.Layer.setResolution ( float  newResolution)
inline

Sets the layer resolution.

This value is used to determine how many pixels per device pixel this layer was rendered at. This will be reflected by scaling by the reciprocal of the resolution in the layer's transform() function. Only valid inside a transaction.

Reimplemented in org.mozilla.gecko.gfx.ComposedTileLayer.

Definition at line 130 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mInTransaction, and org.mozilla.gecko.gfx.Layer.mNewResolution.

◆ update()

final boolean org.mozilla.gecko.gfx.Layer.update ( RenderContext  context)
inline

Updates the layer.

This returns false if there is still work to be done after this update.

Definition at line 45 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mTransactionLock, and org.mozilla.gecko.gfx.Layer.performUpdates().

Referenced by org.mozilla.gecko.gfx.LayerRenderer.Frame.beginDrawing().

◆ usesDefaultProgram()

boolean org.mozilla.gecko.gfx.Layer.usesDefaultProgram ( )
inline

Definition at line 136 of file Layer.java.

References org.mozilla.gecko.gfx.Layer.mUsesDefaultProgram.

Member Data Documentation

◆ mInTransaction

boolean org.mozilla.gecko.gfx.Layer.mInTransaction
private

◆ mNewPosition

Rect org.mozilla.gecko.gfx.Layer.mNewPosition
private

◆ mNewResolution

float org.mozilla.gecko.gfx.Layer.mNewResolution
private

◆ mPosition

Rect org.mozilla.gecko.gfx.Layer.mPosition
protected

◆ mResolution

float org.mozilla.gecko.gfx.Layer.mResolution
protected

◆ mTransactionLock

final ReentrantLock org.mozilla.gecko.gfx.Layer.mTransactionLock
private

◆ mUsesDefaultProgram

boolean org.mozilla.gecko.gfx.Layer.mUsesDefaultProgram = true
protected

Definition at line 25 of file Layer.java.

Referenced by org.mozilla.gecko.gfx.Layer.usesDefaultProgram().


The documentation for this class was generated from the following file: