package com.kofax.kmc.ken.engines.gpu; import android.app.ActivityManager; import android.content.Context; import android.graphics.Bitmap; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class d { private PixelBuffer gr; public d(Context context) { if (!a(context)) { throw new IllegalStateException("OpenGL ES 2.0 is not supported on this phone."); } } private boolean a(Context context) { return ((ActivityManager) context.getSystemService("activity")).getDeviceConfigurationInfo().reqGlEsVersion >= 131072; } public Bitmap getBitmap(int i) { return this.gr.getBitmap(i); } public void handleData(byte[] bArr, int i, int i2, IGPUImageRenderer iGPUImageRenderer) { if (this.gr == null) { this.gr = new PixelBuffer(i, i2); } this.gr.setRenderer(iGPUImageRenderer); iGPUImageRenderer.onPreviewFrame(bArr, i, i2); this.gr.drawFrame(); } public final void destroy() { PixelBuffer pixelBuffer = this.gr; if (pixelBuffer != null) { pixelBuffer.destroy(); this.gr = null; } } }