6package org.mozilla.gecko.gfx;
8import android.graphics.Rect;
9import android.opengl.GLES20;
10import android.util.Log;
12import java.nio.ByteBuffer;
35 super(image ==
null ?
null : image.
getSize());
78 throw new RuntimeException(
"invalidate() is only valid inside a transaction");
110 super.performUpdates(context);
136 if (dirtyRect.isEmpty())
141 if (imageBuffer ==
null)
164 GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
165 GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,
mTextureIDs[0]);
166 GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
168 GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,
171 int repeatMode =
repeats() ? GLES20.GL_REPEAT : GLES20.GL_CLAMP_TO_EDGE;
172 GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, repeatMode);
173 GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, repeatMode);
Information needed to render Cairo bitmaps using OpenGL ES.
abstract ByteBuffer getBuffer()
abstract IntSize getSize()
boolean equals(IntSize size)
static int nextPowerOfTwo(int value)
boolean inTransaction()
Returns true if the layer is currently in a transaction and false otherwise.
Manages a list of dead tiles, so we don't leak resources.
static TextureReaper get()
void add(int[] textureIDs)
Base class for tile layers, which encapsulate the logic needed to draw textured tiles in OpenGL ES.
void uploadDirtyRect(Rect dirtyRect)
static final String LOGTAG
TileLayer(CairoImage image, PaintMode paintMode)
void performUpdates(RenderContext context)
Subclasses may override this method to perform custom layer updates.
void bindAndSetGLParameters()
void setPaintMode(PaintMode mode)
void invalidate()
Invalidates the entire buffer so that it will be uploaded again.