Back to project page FxCameraApp.
The source code is released under:
MIT License
If you think the Android project FxCameraApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.af.experiments.FxCameraApp.ogles; // w w w .j a v a2 s .c o m import android.graphics.Bitmap; public class GlImageBitmapTexture extends GlImageTexture { private Bitmap mBitmap; private final boolean mAutoRecycle; public GlImageBitmapTexture(final Bitmap bitmap) { this(bitmap, true); } public GlImageBitmapTexture(final Bitmap bitmap, final boolean autoRecycle) { mBitmap = bitmap; mAutoRecycle = autoRecycle; } public boolean isAutoRecycle() { return mAutoRecycle; } @Override public void setup() { attachToTexture(mBitmap); } @Override protected void finalize() throws Throwable { try { if (mAutoRecycle) { dispose(); } } finally { super.finalize(); } } public void dispose() { if (mBitmap != null) { if (!mBitmap.isRecycled()) { mBitmap.recycle(); } mBitmap = null; } } }