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

Commit 6e939a5e authored by John Reck's avatar John Reck Committed by Android Git Automerger
Browse files

am 97bf518f: Merge "Reduce wasted buffer allocations" into mnc-dev

* commit '97bf518f':
  Reduce wasted buffer allocations
parents 8cd53b22 97bf518f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@ public class ThreadedRenderer extends HardwareRenderer {
        mInitialized = true;
        updateEnabledState(surface);
        boolean status = nInitialize(mNativeProxy, surface);
        surface.allocateBuffers();
        return status;
    }

+9 −0
Original line number Diff line number Diff line
@@ -1705,10 +1705,19 @@ public final class ViewRootImpl implements ViewParent,
                        mFullRedrawNeeded = true;
                        mPreviousTransparentRegion.setEmpty();

                        // Only initialize up-front if transparent regions are not
                        // requested, otherwise defer to see if the entire window
                        // will be transparent
                        if (mAttachInfo.mHardwareRenderer != null) {
                            try {
                                hwInitialized = mAttachInfo.mHardwareRenderer.initialize(
                                        mSurface);
                                if (hwInitialized && (host.mPrivateFlags
                                        & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) {
                                    // Don't pre-allocate if transparent regions
                                    // are requested as they may not be needed
                                    mSurface.allocateBuffers();
                                }
                            } catch (OutOfResourcesException e) {
                                handleOutOfResourcesException(e);
                                return;