LibreOffice Module android (master) 1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.mozilla.gecko.gfx.ScrollbarLayer Class Reference

Draws a small rect. More...

Inheritance diagram for org.mozilla.gecko.gfx.ScrollbarLayer:
[legend]
Collaboration diagram for org.mozilla.gecko.gfx.ScrollbarLayer:
[legend]

Public Member Functions

boolean fade ()
 Decrease the opacity of the scrollbar by one frame's worth. More...
 
boolean unfade ()
 Restore the opacity of the scrollbar to fully opaque. More...
 
void draw (RenderContext context)
 Subclasses override this function to draw the layer. More...
 
- Public Member Functions inherited from org.mozilla.gecko.gfx.TileLayer
CairoImage getImage ()
 
 TileLayer (CairoImage image, PaintMode paintMode)
 
void destroy ()
 
void setPaintMode (PaintMode mode)
 
void invalidate ()
 Invalidates the entire buffer so that it will be uploaded again. More...
 
- Public Member Functions inherited from org.mozilla.gecko.gfx.Layer
 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 ()
 

Static Public Member Functions

static ScrollbarLayer create (LayerRenderer renderer, boolean vertical)
 

Static Public Attributes

static final long FADE_DELAY = 500
 

Private Member Functions

 ScrollbarLayer (LayerRenderer renderer, CairoImage image, boolean vertical, ByteBuffer buffer)
 
void createProgram ()
 
void activateProgram ()
 
void deactivateProgram ()
 
RectF getVerticalRect (RenderContext context)
 
RectF getHorizontalRect (RenderContext context)
 

Private Attributes

final boolean mVertical
 
final Bitmap mBitmap
 
final Canvas mCanvas
 
float mOpacity
 
LayerRenderer mRenderer
 
int mProgram
 
int mPositionHandle
 
int mTextureHandle
 
int mSampleHandle
 
int mTMatrixHandle
 
int mOpacityHandle
 

Static Private Attributes

static String LOGTAG = LayerView.class.getName()
 
static final float FADE_AMOUNT = 0.03f
 
static final int PADDING = 1
 
static final int BAR_SIZE = 6
 
static final int CAP_RADIUS = (BAR_SIZE / 2)
 
static final String FRAGMENT_SHADER
 
static final float TEX_HEIGHT = 8.0f
 
static final float TEX_WIDTH = 8.0f
 
static final float[] BODY_TEX_COORDS
 
static final float[] TOP_CAP_TEX_COORDS
 
static final float[] BOT_CAP_TEX_COORDS
 
static final float[] LEFT_CAP_TEX_COORDS
 
static final float[] RIGHT_CAP_TEX_COORDS
 

Additional Inherited Members

- Protected Member Functions inherited from org.mozilla.gecko.gfx.TileLayer
boolean repeats ()
 
boolean stretches ()
 
int getTextureID ()
 
boolean initialized ()
 
void finalize () throws Throwable
 
void performUpdates (RenderContext context)
 Subclasses may override this method to perform custom layer updates. More...
 
- Protected Member Functions inherited from org.mozilla.gecko.gfx.Layer
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 inherited from org.mozilla.gecko.gfx.TileLayer
final CairoImage mImage
 
- Protected Attributes inherited from org.mozilla.gecko.gfx.Layer
Rect mPosition
 
float mResolution
 
boolean mUsesDefaultProgram = true
 

Detailed Description

Draws a small rect.

This is scaled to become a scrollbar.

Definition at line 26 of file ScrollbarLayer.java.

Constructor & Destructor Documentation

◆ ScrollbarLayer()

org.mozilla.gecko.gfx.ScrollbarLayer.ScrollbarLayer ( LayerRenderer  renderer,
CairoImage  image,
boolean  vertical,
ByteBuffer  buffer 
)
inlineprivate

Member Function Documentation

◆ activateProgram()

void org.mozilla.gecko.gfx.ScrollbarLayer.activateProgram ( )
inlineprivate

◆ create()

static ScrollbarLayer org.mozilla.gecko.gfx.ScrollbarLayer.create ( LayerRenderer  renderer,
boolean  vertical 
)
inlinestatic

◆ createProgram()

void org.mozilla.gecko.gfx.ScrollbarLayer.createProgram ( )
inlineprivate

◆ deactivateProgram()

void org.mozilla.gecko.gfx.ScrollbarLayer.deactivateProgram ( )
inlineprivate

◆ draw()

void org.mozilla.gecko.gfx.ScrollbarLayer.draw ( RenderContext  context)
inline

Subclasses override this function to draw the layer.

Reimplemented from org.mozilla.gecko.gfx.Layer.

Definition at line 213 of file ScrollbarLayer.java.

References org.mozilla.gecko.gfx.LayerRenderer.activateDefaultProgram(), org.mozilla.gecko.gfx.ScrollbarLayer.activateProgram(), org.mozilla.gecko.gfx.ScrollbarLayer.BAR_SIZE, org.mozilla.gecko.gfx.ScrollbarLayer.BODY_TEX_COORDS, org.mozilla.gecko.gfx.ScrollbarLayer.BOT_CAP_TEX_COORDS, org.mozilla.gecko.gfx.ScrollbarLayer.CAP_RADIUS, org.mozilla.gecko.gfx.Layer.RenderContext.coordBuffer, org.mozilla.gecko.gfx.ScrollbarLayer.createProgram(), org.mozilla.gecko.gfx.LayerRenderer.deactivateDefaultProgram(), org.mozilla.gecko.gfx.ScrollbarLayer.deactivateProgram(), org.mozilla.gecko.gfx.ScrollbarLayer.getHorizontalRect(), org.mozilla.gecko.gfx.TileLayer.getTextureID(), org.mozilla.gecko.gfx.ScrollbarLayer.getVerticalRect(), org.mozilla.gecko.gfx.TileLayer.initialized(), org.mozilla.gecko.gfx.ScrollbarLayer.LEFT_CAP_TEX_COORDS, org.mozilla.gecko.gfx.ScrollbarLayer.mPositionHandle, org.mozilla.gecko.gfx.ScrollbarLayer.mProgram, org.mozilla.gecko.gfx.ScrollbarLayer.mRenderer, org.mozilla.gecko.gfx.ScrollbarLayer.mTextureHandle, org.mozilla.gecko.gfx.ScrollbarLayer.mVertical, Rect, org.mozilla.gecko.gfx.ScrollbarLayer.RIGHT_CAP_TEX_COORDS, org.mozilla.gecko.gfx.RectUtils.round(), top, org.mozilla.gecko.gfx.ScrollbarLayer.TOP_CAP_TEX_COORDS, and org.mozilla.gecko.gfx.Layer.RenderContext.viewport.

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

◆ fade()

boolean org.mozilla.gecko.gfx.ScrollbarLayer.fade ( )
inline

Decrease the opacity of the scrollbar by one frame's worth.

Return true if the opacity was decreased, or false if the scrollbars are already fully faded out.

Definition at line 186 of file ScrollbarLayer.java.

References org.mozilla.gecko.gfx.Layer.beginTransaction(), org.mozilla.gecko.gfx.Layer.endTransaction(), org.mozilla.gecko.gfx.ScrollbarLayer.FADE_AMOUNT, org.mozilla.gecko.util.FloatUtils.fuzzyEquals(), Math, and org.mozilla.gecko.gfx.ScrollbarLayer.mOpacity.

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

◆ getHorizontalRect()

RectF org.mozilla.gecko.gfx.ScrollbarLayer.getHorizontalRect ( RenderContext  context)
inlineprivate

◆ getVerticalRect()

RectF org.mozilla.gecko.gfx.ScrollbarLayer.getVerticalRect ( RenderContext  context)
inlineprivate

◆ unfade()

boolean org.mozilla.gecko.gfx.ScrollbarLayer.unfade ( )
inline

Restore the opacity of the scrollbar to fully opaque.

Return true if the opacity was changed, or false if the scrollbars are already fully opaque.

Definition at line 201 of file ScrollbarLayer.java.

References org.mozilla.gecko.gfx.Layer.beginTransaction(), org.mozilla.gecko.gfx.Layer.endTransaction(), org.mozilla.gecko.util.FloatUtils.fuzzyEquals(), and org.mozilla.gecko.gfx.ScrollbarLayer.mOpacity.

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

Member Data Documentation

◆ BAR_SIZE

final int org.mozilla.gecko.gfx.ScrollbarLayer.BAR_SIZE = 6
staticprivate

◆ BODY_TEX_COORDS

final float [] org.mozilla.gecko.gfx.ScrollbarLayer.BODY_TEX_COORDS
staticprivate

◆ BOT_CAP_TEX_COORDS

final float [] org.mozilla.gecko.gfx.ScrollbarLayer.BOT_CAP_TEX_COORDS
staticprivate

◆ CAP_RADIUS

final int org.mozilla.gecko.gfx.ScrollbarLayer.CAP_RADIUS = (BAR_SIZE / 2)
staticprivate

◆ FADE_AMOUNT

final float org.mozilla.gecko.gfx.ScrollbarLayer.FADE_AMOUNT = 0.03f
staticprivate

Definition at line 29 of file ScrollbarLayer.java.

Referenced by org.mozilla.gecko.gfx.ScrollbarLayer.fade().

◆ FADE_DELAY

final long org.mozilla.gecko.gfx.ScrollbarLayer.FADE_DELAY = 500
static

◆ FRAGMENT_SHADER

final String org.mozilla.gecko.gfx.ScrollbarLayer.FRAGMENT_SHADER
staticprivate
Initial value:
=
"precision mediump float;\n" +
"varying vec2 vTexCoord;\n" +
"uniform sampler2D sTexture;\n" +
"uniform float uOpacity;\n" +
"void main() {\n" +
" gl_FragColor = texture2D(sTexture, vec2(vTexCoord.x, 1.0 - vTexCoord.y));\n" +
" gl_FragColor.a *= uOpacity;\n" +
"}\n"

Definition at line 49 of file ScrollbarLayer.java.

Referenced by org.mozilla.gecko.gfx.ScrollbarLayer.createProgram().

◆ LEFT_CAP_TEX_COORDS

final float [] org.mozilla.gecko.gfx.ScrollbarLayer.LEFT_CAP_TEX_COORDS
staticprivate
Initial value:
= {
0 , 1.0f - BAR_SIZE/TEX_HEIGHT,
0 , 1.0f,
}

Definition at line 92 of file ScrollbarLayer.java.

Referenced by org.mozilla.gecko.gfx.ScrollbarLayer.draw().

◆ LOGTAG

String org.mozilla.gecko.gfx.ScrollbarLayer.LOGTAG = LayerView.class.getName()
staticprivate

Definition at line 27 of file ScrollbarLayer.java.

◆ mBitmap

final Bitmap org.mozilla.gecko.gfx.ScrollbarLayer.mBitmap
private

◆ mCanvas

final Canvas org.mozilla.gecko.gfx.ScrollbarLayer.mCanvas
private

◆ mOpacity

float org.mozilla.gecko.gfx.ScrollbarLayer.mOpacity
private

◆ mOpacityHandle

int org.mozilla.gecko.gfx.ScrollbarLayer.mOpacityHandle
private

◆ mPositionHandle

int org.mozilla.gecko.gfx.ScrollbarLayer.mPositionHandle
private

◆ mProgram

int org.mozilla.gecko.gfx.ScrollbarLayer.mProgram
private

◆ mRenderer

LayerRenderer org.mozilla.gecko.gfx.ScrollbarLayer.mRenderer
private

◆ mSampleHandle

int org.mozilla.gecko.gfx.ScrollbarLayer.mSampleHandle
private

◆ mTextureHandle

int org.mozilla.gecko.gfx.ScrollbarLayer.mTextureHandle
private

◆ mTMatrixHandle

int org.mozilla.gecko.gfx.ScrollbarLayer.mTMatrixHandle
private

◆ mVertical

final boolean org.mozilla.gecko.gfx.ScrollbarLayer.mVertical
private

◆ PADDING

final int org.mozilla.gecko.gfx.ScrollbarLayer.PADDING = 1
staticprivate

◆ RIGHT_CAP_TEX_COORDS

final float [] org.mozilla.gecko.gfx.ScrollbarLayer.RIGHT_CAP_TEX_COORDS
staticprivate

◆ TEX_HEIGHT

final float org.mozilla.gecko.gfx.ScrollbarLayer.TEX_HEIGHT = 8.0f
staticprivate

Definition at line 60 of file ScrollbarLayer.java.

◆ TEX_WIDTH

final float org.mozilla.gecko.gfx.ScrollbarLayer.TEX_WIDTH = 8.0f
staticprivate

Definition at line 61 of file ScrollbarLayer.java.

◆ TOP_CAP_TEX_COORDS

final float [] org.mozilla.gecko.gfx.ScrollbarLayer.TOP_CAP_TEX_COORDS
staticprivate
Initial value:
= {
0 , 1.0f - CAP_RADIUS/TEX_HEIGHT,
0 , 1.0f,
}

Definition at line 74 of file ScrollbarLayer.java.

Referenced by org.mozilla.gecko.gfx.ScrollbarLayer.draw().


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