Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4717cace authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 22222 into eclair

* changes:
  fix a bug in ComponentSizeChooser where it could pick a software EGLConfig instead of a better h/w one.
parents 89668bd2 82fd4fce
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -655,6 +655,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
            EGLConfig closestConfig = null;
            int closestDistance = 1000;
            for(EGLConfig config : configs) {
                int d = findConfigAttrib(egl, display, config,
                        EGL10.EGL_DEPTH_SIZE, 0);
                int s = findConfigAttrib(egl, display, config,
                        EGL10.EGL_STENCIL_SIZE, 0);
                if (d >= mDepthSize && s>= mStencilSize) {
                    int r = findConfigAttrib(egl, display, config,
                            EGL10.EGL_RED_SIZE, 0);
                    int g = findConfigAttrib(egl, display, config,
@@ -663,19 +668,16 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
                              EGL10.EGL_BLUE_SIZE, 0);
                    int a = findConfigAttrib(egl, display, config,
                            EGL10.EGL_ALPHA_SIZE, 0);
                int d = findConfigAttrib(egl, display, config,
                        EGL10.EGL_DEPTH_SIZE, 0);
                int s = findConfigAttrib(egl, display, config,
                        EGL10.EGL_STENCIL_SIZE, 0);
                    int distance = Math.abs(r - mRedSize)
                                + Math.abs(g - mGreenSize)
                    + Math.abs(b - mBlueSize) + Math.abs(a - mAlphaSize)
                    + Math.abs(d - mDepthSize) + Math.abs(s - mStencilSize);
                                + Math.abs(b - mBlueSize)
                                + Math.abs(a - mAlphaSize);
                    if (distance < closestDistance) {
                        closestDistance = distance;
                        closestConfig = config;
                    }
                }
            }
            return closestConfig;
        }

+2 −2
Original line number Diff line number Diff line
@@ -224,12 +224,12 @@ void Loader::init_api(void* dso,

void *Loader::load_driver(const char* driver, gl_hooks_t* hooks, uint32_t mask)
{
    //LOGD("%s", driver);
    void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL);
    LOGE_IF(!dso, "%s", dlerror());
    if (dso == 0)
        return 0;

    LOGD("loaded %s", driver);

    if (mask & EGL) {
        getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");