package com.unity3d.player;

import com.flurry.org.codehaus.jackson.util.MinimalPrettyPrinter;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/2.dex */
public final class u {
    final EGLConfig a;
    private EGL10 b;
    private EGLDisplay c;

    /* JADX INFO: Access modifiers changed from: package-private */
    public u(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig) {
        this.b = egl10;
        this.c = eGLDisplay;
        this.a = eGLConfig;
    }

    private static void a(String str, EGL10 egl10) {
        for (int i = 0; i < 2; i++) {
            int eglGetError = egl10.eglGetError();
            if (eglGetError == 12288) {
                return;
            }
            m.Log(6, String.format("%s: EGL error: 0x%x", str, Integer.valueOf(eglGetError)));
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final int a(int i) {
        int[] iArr = new int[1];
        if (this.b.eglGetConfigAttrib(this.c, this.a, i, iArr)) {
            return iArr[0];
        }
        int eglGetError = this.b.eglGetError();
        if (eglGetError != 12292) {
            m.Log(6, String.format("findConfigAttrib: EGL error: 0x%x", Integer.valueOf(eglGetError)));
        }
        a("findConfigAttrib (" + Integer.toHexString(i) + ")", this.b);
        return 0;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final String a() {
        int a = a(12320);
        int a2 = a(12324);
        int a3 = a(12323);
        int a4 = a(12322);
        int a5 = a(12321);
        int a6 = a(12325);
        int a7 = a(12326);
        int a8 = a(12337);
        int a9 = a(12513);
        return (a5 == 0 ? "RGB" : "RGBA") + a + MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR + Integer.toString(a2) + Integer.toString(a3) + Integer.toString(a4) + (a5 == 0 ? "" : Integer.toString(a5)) + MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR + Integer.toString(a6) + "/" + Integer.toString(a7) + (a8 < 2 ? "" : " AAx" + Integer.toString(a8)) + (a9 < 2 ? "" : " CSAAx" + Integer.toString(a9));
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final boolean a(u uVar) {
        return a(12324) == uVar.a(12324) && a(12323) == uVar.a(12323) && a(12322) == uVar.a(12322) && a(12321) == uVar.a(12321);
    }

    public final String toString() {
        int[] iArr = {12320, 12321, 12322, 12323, 12324, 12325, 12326, 12327, 12328, 12329, 12330, 12331, 12332, 12333, 12334, 12335, 12336, 12337, 12338, 12339, 12340, 12343, 12342, 12341, 12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352, 12354, 12512, 12513};
        String[] strArr = {"EGL_BUFFER_SIZE", "EGL_ALPHA_SIZE", "EGL_BLUE_SIZE", "EGL_GREEN_SIZE", "EGL_RED_SIZE", "EGL_DEPTH_SIZE", "EGL_STENCIL_SIZE", "EGL_CONFIG_CAVEAT", "EGL_CONFIG_ID", "EGL_LEVEL", "EGL_MAX_PBUFFER_HEIGHT", "EGL_MAX_PBUFFER_PIXELS", "EGL_MAX_PBUFFER_WIDTH", "EGL_NATIVE_RENDERABLE", "EGL_NATIVE_VISUAL_ID", "EGL_NATIVE_VISUAL_TYPE", "EGL_PRESERVED_RESOURCES", "EGL_SAMPLES", "EGL_SAMPLE_BUFFERS", "EGL_SURFACE_TYPE", "EGL_TRANSPARENT_TYPE", "EGL_TRANSPARENT_RED_VALUE", "EGL_TRANSPARENT_GREEN_VALUE", "EGL_TRANSPARENT_BLUE_VALUE", "EGL_BIND_TO_TEXTURE_RGB", "EGL_BIND_TO_TEXTURE_RGBA", "EGL_MIN_SWAP_INTERVAL", "EGL_MAX_SWAP_INTERVAL", "EGL_LUMINANCE_SIZE", "EGL_ALPHA_MASK_SIZE", "EGL_COLOR_BUFFER_TYPE", "EGL_RENDERABLE_TYPE", "EGL_CONFORMANT", "EGL_COVERAGE_BUFFERS_NV", "EGL_COVERAGE_SAMPLES_NV"};
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < iArr.length; i++) {
            sb.append(String.format("  %s: %d\n", strArr[i], Integer.valueOf(a(iArr[i]))));
        }
        return sb.toString();
    }
}
