LibreOffice Module android (master) 1
|
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 |
Definition at line 17 of file Layer.java.
|
inline |
Definition at line 27 of file Layer.java.
|
inline |
Definition at line 31 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mPosition, org.mozilla.gecko.gfx.Layer.mResolution, org.mozilla.gecko.gfx.Layer.mTransactionLock, Rect, and size.
|
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().
|
abstract |
Subclasses override this function to draw the layer.
Reimplemented in org.libreoffice.overlay.DocumentOverlay.DocumentOverlayLayer, org.mozilla.gecko.gfx.ComposedTileLayer, org.mozilla.gecko.gfx.NinePatchTileLayer, org.mozilla.gecko.gfx.ScrollbarLayer, org.mozilla.gecko.gfx.SingleTileLayer, and org.mozilla.gecko.gfx.SubTile.
|
inline |
Call this when you're done modifying the layer.
Reimplemented in org.mozilla.gecko.gfx.ComposedTileLayer.
Definition at line 96 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mInTransaction, and org.mozilla.gecko.gfx.Layer.mTransactionLock.
Referenced by org.mozilla.gecko.gfx.ScrollbarLayer.fade(), and org.mozilla.gecko.gfx.ScrollbarLayer.unfade().
|
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().
|
inlineprotected |
Given the intrinsic size of the layer, returns the pixel boundaries of the layer rect.
Definition at line 67 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mPosition, org.mozilla.gecko.gfx.Layer.mResolution, org.mozilla.gecko.gfx.RectUtils.scale(), and org.mozilla.gecko.gfx.Layer.RenderContext.zoomFactor.
Referenced by org.mozilla.gecko.gfx.SingleTileLayer.draw(), org.mozilla.gecko.gfx.SubTile.draw(), org.mozilla.gecko.gfx.LayerRenderer.Frame.getMaskForLayer(), and org.mozilla.gecko.gfx.Layer.getValidRegion().
|
inline |
Returns the current layer position.
Definition at line 109 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mPosition, and Rect.
|
inline |
Returns the current layer's resolution.
Definition at line 121 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mResolution.
|
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().
|
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().
|
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().
|
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().
|
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.
|
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().
|
inline |
Definition at line 136 of file Layer.java.
References org.mozilla.gecko.gfx.Layer.mUsesDefaultProgram.
|
private |
|
private |
Definition at line 20 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.performUpdates(), and org.mozilla.gecko.gfx.Layer.setPosition().
|
private |
Definition at line 21 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.beginTransaction(), org.mozilla.gecko.gfx.Layer.performUpdates(), and org.mozilla.gecko.gfx.Layer.setResolution().
|
protected |
Definition at line 23 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.getBounds(), org.mozilla.gecko.gfx.Layer.getPosition(), org.mozilla.gecko.gfx.Layer.Layer(), and org.mozilla.gecko.gfx.Layer.performUpdates().
|
protected |
Definition at line 24 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.beginTransaction(), org.mozilla.gecko.gfx.Layer.getBounds(), org.mozilla.gecko.gfx.Layer.getResolution(), org.mozilla.gecko.gfx.Layer.Layer(), and org.mozilla.gecko.gfx.Layer.performUpdates().
|
private |
Definition at line 18 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.beginTransaction(), org.mozilla.gecko.gfx.Layer.endTransaction(), org.mozilla.gecko.gfx.Layer.Layer(), and org.mozilla.gecko.gfx.Layer.update().
|
protected |
Definition at line 25 of file Layer.java.
Referenced by org.mozilla.gecko.gfx.Layer.usesDefaultProgram().