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

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

Merge change 25435 into eclair

* changes:
  disable backbuffer preservation when possible, which may improve performance a bit
parents 81521abe af369f62
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -174,6 +174,13 @@ void DisplayHardware::init(uint32_t dpy)

    surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL);

    if (mFlags & UPDATE_ON_DEMAND) {
        // if we have update on demand, we definitely don't need to
        // preserve the backbuffer, which is usually costly.
        eglSurfaceAttrib(display, surface,
                EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
    }

    if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) {
        if (dummy == EGL_BUFFER_PRESERVED) {
            mFlags |= BUFFER_PRESERVED;