FileDocCategorySizeDatePackage
GLES20Canvas.javaAPI DocAndroid 5.1 API35399Thu Mar 12 22:22:10 GMT 2015android.view

GLES20Canvas

public class GLES20Canvas extends HardwareCanvas
An implementation of Canvas on top of OpenGL ES 2.0.

Fields Summary
private final boolean
mOpaque
protected long
mRenderer
private CanvasFinalizer
mFinalizer
private int
mWidth
private int
mHeight
private float[]
mPoint
private float[]
mLine
private android.graphics.Rect
mClipBounds
private android.graphics.RectF
mPathBounds
private android.graphics.DrawFilter
mFilter
private static boolean
sIsAvailable
Constructors Summary
protected GLES20Canvas()

        mOpaque = false;
        mRenderer = nCreateDisplayListRenderer();
        setupFinalizer();
    
Methods Summary
public intcallDrawGLFunction2(long drawGLFunction)

        return nCallDrawGLFunction(mRenderer, drawGLFunction);
    
public booleanclipPath(android.graphics.Path path)

        return nClipPath(mRenderer, path.mNativePath, Region.Op.INTERSECT.nativeInt);
    
public booleanclipPath(android.graphics.Path path, Region.Op op)

        return nClipPath(mRenderer, path.mNativePath, op.nativeInt);
    
public booleanclipRect(float left, float top, float right, float bottom)

        return nClipRect(mRenderer, left, top, right, bottom, Region.Op.INTERSECT.nativeInt);
    
public booleanclipRect(float left, float top, float right, float bottom, Region.Op op)

        return nClipRect(mRenderer, left, top, right, bottom, op.nativeInt);
    
public booleanclipRect(int left, int top, int right, int bottom)

        return nClipRect(mRenderer, left, top, right, bottom, Region.Op.INTERSECT.nativeInt);
    
public booleanclipRect(android.graphics.Rect rect)

        return nClipRect(mRenderer, rect.left, rect.top, rect.right, rect.bottom,
                Region.Op.INTERSECT.nativeInt);
    
public booleanclipRect(android.graphics.Rect rect, Region.Op op)

        return nClipRect(mRenderer, rect.left, rect.top, rect.right, rect.bottom, op.nativeInt);
    
public booleanclipRect(android.graphics.RectF rect)

        return nClipRect(mRenderer, rect.left, rect.top, rect.right, rect.bottom,
                Region.Op.INTERSECT.nativeInt);
    
public booleanclipRect(android.graphics.RectF rect, Region.Op op)

        return nClipRect(mRenderer, rect.left, rect.top, rect.right, rect.bottom, op.nativeInt);
    
public booleanclipRegion(android.graphics.Region region)

        return nClipRegion(mRenderer, region.mNativeRegion, Region.Op.INTERSECT.nativeInt);
    
public booleanclipRegion(android.graphics.Region region, Region.Op op)

        return nClipRegion(mRenderer, region.mNativeRegion, op.nativeInt);
    
public voidconcat(android.graphics.Matrix matrix)

        if (matrix != null) nConcatMatrix(mRenderer, matrix.native_instance);
    
public voiddrawARGB(int a, int r, int g, int b)

        drawColor((a & 0xFF) << 24 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF));
    
public voiddrawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, android.graphics.Paint paint)

        nDrawArc(mRenderer, left, top, right, bottom,
                startAngle, sweepAngle, useCenter, paint.mNativePaint);
    
public voiddrawBitmap(android.graphics.Bitmap bitmap, float left, float top, android.graphics.Paint paint)

        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, nativePaint);
    
public voiddrawBitmap(android.graphics.Bitmap bitmap, android.graphics.Matrix matrix, android.graphics.Paint paint)

        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawBitmap(mRenderer, bitmap.mNativeBitmap, matrix.native_instance, nativePaint);
    
public voiddrawBitmap(android.graphics.Bitmap bitmap, android.graphics.Rect src, android.graphics.Rect dst, android.graphics.Paint paint)

        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;

        int left, top, right, bottom;
        if (src == null) {
            left = top = 0;
            right = bitmap.getWidth();
            bottom = bitmap.getHeight();
        } else {
            left = src.left;
            right = src.right;
            top = src.top;
            bottom = src.bottom;
        }

        nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, right, bottom,
                dst.left, dst.top, dst.right, dst.bottom, nativePaint);
    
public voiddrawBitmap(android.graphics.Bitmap bitmap, android.graphics.Rect src, android.graphics.RectF dst, android.graphics.Paint paint)

        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;

        float left, top, right, bottom;
        if (src == null) {
            left = top = 0;
            right = bitmap.getWidth();
            bottom = bitmap.getHeight();
        } else {
            left = src.left;
            right = src.right;
            top = src.top;
            bottom = src.bottom;
        }

        nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, right, bottom,
                dst.left, dst.top, dst.right, dst.bottom, nativePaint);
    
public voiddrawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, android.graphics.Paint paint)

        if (width < 0) {
            throw new IllegalArgumentException("width must be >= 0");
        }

        if (height < 0) {
            throw new IllegalArgumentException("height must be >= 0");
        }

        if (Math.abs(stride) < width) {
            throw new IllegalArgumentException("abs(stride) must be >= width");
        }

        int lastScanline = offset + (height - 1) * stride;
        int length = colors.length;

        if (offset < 0 || (offset + width > length) || lastScanline < 0 ||
                (lastScanline + width > length)) {
            throw new ArrayIndexOutOfBoundsException();
        }

        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawBitmap(mRenderer, colors, offset, stride, x, y,
                width, height, hasAlpha, nativePaint);
    
public voiddrawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, android.graphics.Paint paint)

        drawBitmap(colors, offset, stride, (float) x, (float) y, width, height, hasAlpha, paint);
    
public voiddrawBitmapMesh(android.graphics.Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, android.graphics.Paint paint)

        throwIfCannotDraw(bitmap);
        if (meshWidth < 0 || meshHeight < 0 || vertOffset < 0 || colorOffset < 0) {
            throw new ArrayIndexOutOfBoundsException();
        }

        if (meshWidth == 0 || meshHeight == 0) {
            return;
        }

        final int count = (meshWidth + 1) * (meshHeight + 1);
        checkRange(verts.length, vertOffset, count * 2);

        if (colors != null) {
            checkRange(colors.length, colorOffset, count);
        }

        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawBitmapMesh(mRenderer, bitmap.mNativeBitmap, meshWidth, meshHeight,
                verts, vertOffset, colors, colorOffset, nativePaint);
    
public voiddrawCircle(float cx, float cy, float radius, android.graphics.Paint paint)

        nDrawCircle(mRenderer, cx, cy, radius, paint.mNativePaint);
    
public voiddrawCircle(android.graphics.CanvasProperty cx, android.graphics.CanvasProperty cy, android.graphics.CanvasProperty radius, android.graphics.CanvasProperty paint)

        nDrawCircle(mRenderer, cx.getNativeContainer(), cy.getNativeContainer(),
                radius.getNativeContainer(), paint.getNativeContainer());
    
public voiddrawColor(int color)

        drawColor(color, PorterDuff.Mode.SRC_OVER);
    
public voiddrawColor(int color, PorterDuff.Mode mode)

        nDrawColor(mRenderer, color, mode.nativeInt);
    
voiddrawHardwareLayer(HardwareLayer layer, float x, float y, android.graphics.Paint paint)

        layer.setLayerPaint(paint);
        nDrawLayer(mRenderer, layer.getLayerHandle(), x, y);
    
public voiddrawLine(float startX, float startY, float stopX, float stopY, android.graphics.Paint paint)

        float[] line = getLineStorage();
        line[0] = startX;
        line[1] = startY;
        line[2] = stopX;
        line[3] = stopY;
        drawLines(line, 0, 4, paint);
    
public voiddrawLines(float[] pts, int offset, int count, android.graphics.Paint paint)

        if (count < 4) return;

        if ((offset | count) < 0 || offset + count > pts.length) {
            throw new IllegalArgumentException("The lines array must contain 4 elements per line.");
        }
        nDrawLines(mRenderer, pts, offset, count, paint.mNativePaint);
    
public voiddrawLines(float[] pts, android.graphics.Paint paint)

        drawLines(pts, 0, pts.length, paint);
    
public voiddrawOval(float left, float top, float right, float bottom, android.graphics.Paint paint)

        nDrawOval(mRenderer, left, top, right, bottom, paint.mNativePaint);
    
public voiddrawPaint(android.graphics.Paint paint)

        final Rect r = getInternalClipBounds();
        nGetClipBounds(mRenderer, r);
        drawRect(r.left, r.top, r.right, r.bottom, paint);
    
public voiddrawPatch(android.graphics.NinePatch patch, android.graphics.Rect dst, android.graphics.Paint paint)

        Bitmap bitmap = patch.getBitmap();
        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawPatch(mRenderer, bitmap.mNativeBitmap, patch.mNativeChunk,
                dst.left, dst.top, dst.right, dst.bottom, nativePaint);
    
public voiddrawPatch(android.graphics.NinePatch patch, android.graphics.RectF dst, android.graphics.Paint paint)

        Bitmap bitmap = patch.getBitmap();
        throwIfCannotDraw(bitmap);
        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        nDrawPatch(mRenderer, bitmap.mNativeBitmap, patch.mNativeChunk,
                dst.left, dst.top, dst.right, dst.bottom, nativePaint);
    
public voiddrawPath(android.graphics.Path path, android.graphics.Paint paint)

        if (path.isSimplePath) {
            if (path.rects != null) {
                nDrawRects(mRenderer, path.rects.mNativeRegion, paint.mNativePaint);
            }
        } else {
            nDrawPath(mRenderer, path.mNativePath, paint.mNativePaint);
        }
    
public voiddrawPicture(android.graphics.Picture picture)

        picture.endRecording();
        // TODO: Implement rendering
    
public voiddrawPoint(float x, float y, android.graphics.Paint paint)

        float[] point = getPointStorage();
        point[0] = x;
        point[1] = y;
        drawPoints(point, 0, 2, paint);
    
public voiddrawPoints(float[] pts, android.graphics.Paint paint)

        drawPoints(pts, 0, pts.length, paint);
    
public voiddrawPoints(float[] pts, int offset, int count, android.graphics.Paint paint)

        if (count < 2) return;

        nDrawPoints(mRenderer, pts, offset, count, paint.mNativePaint);
    
public voiddrawRGB(int r, int g, int b)

        drawColor(0xFF000000 | (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF));
    
public voiddrawRect(float left, float top, float right, float bottom, android.graphics.Paint paint)

        if (left == right || top == bottom) return;
        nDrawRect(mRenderer, left, top, right, bottom, paint.mNativePaint);
    
public voiddrawRect(android.graphics.Rect r, android.graphics.Paint paint)

        drawRect(r.left, r.top, r.right, r.bottom, paint);
    
public voiddrawRect(android.graphics.RectF r, android.graphics.Paint paint)

        drawRect(r.left, r.top, r.right, r.bottom, paint);
    
public intdrawRenderNode(RenderNode renderNode, android.graphics.Rect dirty, int flags)

        return nDrawRenderNode(mRenderer, renderNode.getNativeDisplayList(), dirty, flags);
    
public voiddrawRoundRect(android.graphics.CanvasProperty left, android.graphics.CanvasProperty top, android.graphics.CanvasProperty right, android.graphics.CanvasProperty bottom, android.graphics.CanvasProperty rx, android.graphics.CanvasProperty ry, android.graphics.CanvasProperty paint)

        nDrawRoundRect(mRenderer, left.getNativeContainer(), top.getNativeContainer(),
                right.getNativeContainer(), bottom.getNativeContainer(),
                rx.getNativeContainer(), ry.getNativeContainer(),
                paint.getNativeContainer());
    
public voiddrawRoundRect(float left, float top, float right, float bottom, float rx, float ry, android.graphics.Paint paint)

        nDrawRoundRect(mRenderer, left, top, right, bottom, rx, ry, paint.mNativePaint);
    
public voiddrawText(char[] text, int index, int count, float x, float y, android.graphics.Paint paint)

        if ((index | count | (index + count) | (text.length - index - count)) < 0) {
            throw new IndexOutOfBoundsException();
        }

        nDrawText(mRenderer, text, index, count, x, y,
                paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawText(java.lang.CharSequence text, int start, int end, float x, float y, android.graphics.Paint paint)

        if ((start | end | (end - start) | (text.length() - end)) < 0) {
            throw new IndexOutOfBoundsException();
        }
        if (text instanceof String || text instanceof SpannedString ||
                text instanceof SpannableString) {
            nDrawText(mRenderer, text.toString(), start, end, x, y, paint.mBidiFlags,
                    paint.mNativePaint, paint.mNativeTypeface);
        } else if (text instanceof GraphicsOperations) {
            ((GraphicsOperations) text).drawText(this, start, end, x, y, paint);
        } else {
            char[] buf = TemporaryBuffer.obtain(end - start);
            TextUtils.getChars(text, start, end, buf, 0);
            nDrawText(mRenderer, buf, 0, end - start, x, y,
                    paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
            TemporaryBuffer.recycle(buf);
        }
    
public voiddrawText(java.lang.String text, int start, int end, float x, float y, android.graphics.Paint paint)

        if ((start | end | (end - start) | (text.length() - end)) < 0) {
            throw new IndexOutOfBoundsException();
        }

        nDrawText(mRenderer, text, start, end, x, y,
                paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawText(java.lang.String text, float x, float y, android.graphics.Paint paint)

        nDrawText(mRenderer, text, 0, text.length(), x, y,
                paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawTextOnPath(char[] text, int index, int count, android.graphics.Path path, float hOffset, float vOffset, android.graphics.Paint paint)

        if (index < 0 || index + count > text.length) {
            throw new ArrayIndexOutOfBoundsException();
        }

        nDrawTextOnPath(mRenderer, text, index, count, path.mNativePath, hOffset, vOffset,
                paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawTextOnPath(java.lang.String text, android.graphics.Path path, float hOffset, float vOffset, android.graphics.Paint paint)

        if (text.length() == 0) return;

        nDrawTextOnPath(mRenderer, text, 0, text.length(), path.mNativePath, hOffset, vOffset,
                paint.mBidiFlags, paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, android.graphics.Paint paint)

        if ((index | count | text.length - index - count) < 0) {
            throw new IndexOutOfBoundsException();
        }

        nDrawTextRun(mRenderer, text, index, count, contextIndex, contextCount, x, y, isRtl,
                paint.mNativePaint, paint.mNativeTypeface);
    
public voiddrawTextRun(java.lang.CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, android.graphics.Paint paint)

        if ((start | end | end - start | text.length() - end) < 0) {
            throw new IndexOutOfBoundsException();
        }

        if (text instanceof String || text instanceof SpannedString ||
                text instanceof SpannableString) {
            nDrawTextRun(mRenderer, text.toString(), start, end, contextStart,
                    contextEnd, x, y, isRtl, paint.mNativePaint, paint.mNativeTypeface);
        } else if (text instanceof GraphicsOperations) {
            ((GraphicsOperations) text).drawTextRun(this, start, end,
                    contextStart, contextEnd, x, y, isRtl, paint);
        } else {
            int contextLen = contextEnd - contextStart;
            int len = end - start;
            char[] buf = TemporaryBuffer.obtain(contextLen);
            TextUtils.getChars(text, contextStart, contextEnd, buf, 0);
            nDrawTextRun(mRenderer, buf, start - contextStart, len, 0, contextLen,
                    x, y, isRtl, paint.mNativePaint, paint.mNativeTypeface);
            TemporaryBuffer.recycle(buf);
        }
    
public voiddrawVertices(VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, android.graphics.Paint paint)

        // TODO: Implement
    
public booleangetClipBounds(android.graphics.Rect bounds)

        return nGetClipBounds(mRenderer, bounds);
    
public android.graphics.DrawFiltergetDrawFilter()

        return mFilter;
    
public intgetHeight()

        return mHeight;
    
private android.graphics.RectgetInternalClipBounds()

        if (mClipBounds == null) mClipBounds = new Rect();
        return mClipBounds;
    
private float[]getLineStorage()

        if (mLine == null) mLine = new float[4];
        return mLine;
    
public voidgetMatrix(android.graphics.Matrix matrix)

        nGetMatrix(mRenderer, matrix.native_instance);
    
public intgetMaximumBitmapHeight()

        return nGetMaximumTextureHeight();
    
public intgetMaximumBitmapWidth()

        return nGetMaximumTextureWidth();
    
private android.graphics.RectFgetPathBounds()

        if (mPathBounds == null) mPathBounds = new RectF();
        return mPathBounds;
    
private float[]getPointStorage()

        if (mPoint == null) mPoint = new float[2];
        return mPoint;
    
longgetRenderer()
Returns the native OpenGLRenderer object.

        return mRenderer;
    
public intgetSaveCount()

        return nGetSaveCount(mRenderer);
    
public intgetWidth()

        return mWidth;
    
public voidinsertInorderBarrier()

        nInsertReorderBarrier(mRenderer, false);
    
public voidinsertReorderBarrier()

        nInsertReorderBarrier(mRenderer, true);
    
static booleanisAvailable()


       
        return sIsAvailable;
    
public booleanisOpaque()

        return mOpaque;
    
private static native intnCallDrawGLFunction(long renderer, long drawGLFunction)

private static native booleannClipPath(long renderer, long path, int op)

private static native booleannClipRect(long renderer, float left, float top, float right, float bottom, int op)

private static native booleannClipRect(long renderer, int left, int top, int right, int bottom, int op)

private static native booleannClipRegion(long renderer, long region, int op)

private static native voidnConcatMatrix(long renderer, long matrix)

private static native longnCreateDisplayListRenderer()

private static native voidnDestroyRenderer(long renderer)

private static native voidnDrawArc(long renderer, float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, long paint)

private static native voidnDrawBitmap(long renderer, long bitmap, float left, float top, long paint)

private static native voidnDrawBitmap(long renderer, long bitmap, long matrix, long paint)

private static native voidnDrawBitmap(long renderer, long bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float left, float top, float right, float bottom, long paint)

private static native voidnDrawBitmap(long renderer, int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, long nativePaint)

private static native voidnDrawBitmapMesh(long renderer, long bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long paint)

private static native voidnDrawCircle(long renderer, float cx, float cy, float radius, long paint)

private static native voidnDrawCircle(long renderer, long propCx, long propCy, long propRadius, long propPaint)

private static native voidnDrawColor(long renderer, int color, int mode)

private static native voidnDrawLayer(long renderer, long layer, float x, float y)

private static native voidnDrawLines(long renderer, float[] points, int offset, int count, long paint)

private static native voidnDrawOval(long renderer, float left, float top, float right, float bottom, long paint)

private static native voidnDrawPatch(long renderer, long bitmap, long chunk, float left, float top, float right, float bottom, long paint)

private static native voidnDrawPath(long renderer, long path, long paint)

private static native voidnDrawPoints(long renderer, float[] points, int offset, int count, long paint)

private static native voidnDrawRect(long renderer, float left, float top, float right, float bottom, long paint)

private static native voidnDrawRects(long renderer, long region, long paint)

private static native intnDrawRenderNode(long renderer, long renderNode, android.graphics.Rect dirty, int flags)

private static native voidnDrawRoundRect(long renderer, long propLeft, long propTop, long propRight, long propBottom, long propRx, long propRy, long propPaint)

private static native voidnDrawRoundRect(long renderer, float left, float top, float right, float bottom, float rx, float y, long paint)

private static native voidnDrawText(long renderer, char[] text, int index, int count, float x, float y, int bidiFlags, long paint, long typeface)

private static native voidnDrawText(long renderer, java.lang.String text, int start, int end, float x, float y, int bidiFlags, long paint, long typeface)

private static native voidnDrawTextOnPath(long renderer, char[] text, int index, int count, long path, float hOffset, float vOffset, int bidiFlags, long nativePaint, long typeface)

private static native voidnDrawTextOnPath(long renderer, java.lang.String text, int start, int end, long path, float hOffset, float vOffset, int bidiFlags, long nativePaint, long typeface)

private static native voidnDrawTextRun(long renderer, char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, long nativePaint, long nativeTypeface)

private static native voidnDrawTextRun(long renderer, java.lang.String text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, long nativePaint, long nativeTypeface)

private static native voidnFinish(long renderer)

protected static native longnFinishRecording(long renderer)

private static native booleannGetClipBounds(long renderer, android.graphics.Rect bounds)

private static native voidnGetMatrix(long renderer, long matrix)

private static native intnGetMaximumTextureHeight()

private static native intnGetMaximumTextureWidth()

private static native intnGetSaveCount(long renderer)

private static native voidnInsertReorderBarrier(long renderer, boolean enableReorder)

private static native booleannIsAvailable()

private static native intnPrepare(long renderer, boolean opaque)

private static native intnPrepareDirty(long renderer, int left, int top, int right, int bottom, boolean opaque)

private static native booleannQuickReject(long renderer, float left, float top, float right, float bottom)

private static native voidnResetDisplayListRenderer(long renderer)

private static native voidnResetPaintFilter(long renderer)

private static native voidnRestore(long renderer)

private static native voidnRestoreToCount(long renderer, int saveCount)

private static native voidnRotate(long renderer, float degrees)

private static native intnSave(long renderer, int flags)

private static native intnSaveLayer(long renderer, long paint, int saveFlags)

private static native intnSaveLayer(long renderer, float left, float top, float right, float bottom, long paint, int saveFlags)

private static native intnSaveLayerAlpha(long renderer, int alpha, int saveFlags)

private static native intnSaveLayerAlpha(long renderer, float left, float top, float right, float bottom, int alpha, int saveFlags)

private static native voidnScale(long renderer, float sx, float sy)

private static native voidnSetHighContrastText(long renderer, boolean highContrastText)

private static native voidnSetMatrix(long renderer, long matrix)

private static native voidnSetProperty(java.lang.String name, java.lang.String value)

private static native voidnSetViewport(long renderer, int width, int height)

private static native voidnSetupPaintFilter(long renderer, int clearBits, int setBits)

private static native voidnSkew(long renderer, float sx, float sy)

private static native voidnTranslate(long renderer, float dx, float dy)

public voidonPostDraw()

        nFinish(mRenderer);
    
public intonPreDraw(android.graphics.Rect dirty)

        if (dirty != null) {
            return nPrepareDirty(mRenderer, dirty.left, dirty.top, dirty.right, dirty.bottom,
                    mOpaque);
        } else {
            return nPrepare(mRenderer, mOpaque);
        }
    
public booleanquickReject(float left, float top, float right, float bottom, EdgeType type)

        return nQuickReject(mRenderer, left, top, right, bottom);
    
public booleanquickReject(android.graphics.Path path, EdgeType type)

        RectF pathBounds = getPathBounds();
        path.computeBounds(pathBounds, true);
        return nQuickReject(mRenderer, pathBounds.left, pathBounds.top,
                pathBounds.right, pathBounds.bottom);
    
public booleanquickReject(android.graphics.RectF rect, EdgeType type)

        return nQuickReject(mRenderer, rect.left, rect.top, rect.right, rect.bottom);
    
public voidrestore()

        nRestore(mRenderer);
    
public voidrestoreToCount(int saveCount)

        nRestoreToCount(mRenderer, saveCount);
    
public voidrotate(float degrees)

        nRotate(mRenderer, degrees);
    
public intsave()

        return nSave(mRenderer, Canvas.CLIP_SAVE_FLAG | Canvas.MATRIX_SAVE_FLAG);
    
public intsave(int saveFlags)

        return nSave(mRenderer, saveFlags);
    
public intsaveLayer(android.graphics.RectF bounds, android.graphics.Paint paint, int saveFlags)

        if (bounds != null) {
            return saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, paint, saveFlags);
        }

        final long nativePaint = paint == null ? 0 : paint.mNativePaint;
        return nSaveLayer(mRenderer, nativePaint, saveFlags);
    
public intsaveLayer(float left, float top, float right, float bottom, android.graphics.Paint paint, int saveFlags)

        if (left < right && top < bottom) {
            final long nativePaint = paint == null ? 0 : paint.mNativePaint;
            return nSaveLayer(mRenderer, left, top, right, bottom, nativePaint, saveFlags);
        }
        return save(saveFlags);
    
public intsaveLayerAlpha(android.graphics.RectF bounds, int alpha, int saveFlags)

        if (bounds != null) {
            return saveLayerAlpha(bounds.left, bounds.top, bounds.right, bounds.bottom,
                    alpha, saveFlags);
        }
        return nSaveLayerAlpha(mRenderer, alpha, saveFlags);
    
public intsaveLayerAlpha(float left, float top, float right, float bottom, int alpha, int saveFlags)

        if (left < right && top < bottom) {
            return nSaveLayerAlpha(mRenderer, left, top, right, bottom, alpha, saveFlags);
        }
        return save(saveFlags);
    
public voidscale(float sx, float sy)

        nScale(mRenderer, sx, sy);
    
public voidsetDrawFilter(android.graphics.DrawFilter filter)

        mFilter = filter;
        if (filter == null) {
            nResetPaintFilter(mRenderer);
        } else if (filter instanceof PaintFlagsDrawFilter) {
            PaintFlagsDrawFilter flagsFilter = (PaintFlagsDrawFilter) filter;
            nSetupPaintFilter(mRenderer, flagsFilter.clearBits, flagsFilter.setBits);
        }
    
public voidsetHighContrastText(boolean highContrastText)

        nSetHighContrastText(mRenderer, highContrastText);
    
public voidsetMatrix(android.graphics.Matrix matrix)

        nSetMatrix(mRenderer, matrix == null ? 0 : matrix.native_instance);
    
public static voidsetProperty(java.lang.String name, java.lang.String value)

        nSetProperty(name, value);
    
public voidsetViewport(int width, int height)

        mWidth = width;
        mHeight = height;

        nSetViewport(mRenderer, width, height);
    
private voidsetupFinalizer()

        if (mRenderer == 0) {
            throw new IllegalStateException("Could not create GLES20Canvas renderer");
        } else {
            mFinalizer = new CanvasFinalizer(mRenderer);
        }
    
public voidskew(float sx, float sy)

        nSkew(mRenderer, sx, sy);
    
public voidtranslate(float dx, float dy)

        if (dx != 0.0f || dy != 0.0f) nTranslate(mRenderer, dx, dy);