6package org.mozilla.gecko.gfx;
8import android.graphics.Rect;
9import android.graphics.RectF;
10import android.graphics.Region;
11import android.graphics.RegionIterator;
12import android.opengl.GLES20;
14import java.nio.FloatBuffer;
48 super(image, paintMode);
133 GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
134 GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,
getTextureID());
137 coordBuffer.position(0);
141 GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
144 coordBuffer.position(0);
145 GLES20.glVertexAttribPointer(positionHandle, 3, GLES20.GL_FLOAT,
false, 20, coordBuffer);
148 coordBuffer.position(3);
149 GLES20.glVertexAttribPointer(textureHandle, 2, GLES20.GL_FLOAT,
false, 20, coordBuffer);
150 GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
final FloatBuffer coordBuffer
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.
RectF getBounds(RenderContext context)
Given the intrinsic size of the layer, returns the pixel boundaries of the layer rect.
Encapsulates the logic needed to draw a single textured tile.
final Region mMaskedBounds
SingleTileLayer(boolean repeat, CairoImage image)
SingleTileLayer(CairoImage image, TileLayer.PaintMode paintMode)
static final String LOGTAG
final RectF mTextureBounds
SingleTileLayer(CairoImage image)
void setMask(Rect aMaskRect)
Set an area to mask out when rendering.
void draw(RenderContext context)
Subclasses override this function to draw the layer.
Base class for tile layers, which encapsulate the logic needed to draw textured tiles in OpenGL ES.