Immediately apply transaction when hw rendering is disabled

When hw rendering is disabled, we can't merge the transaction with the
next frame because the frame drawing callback won't be invoked. Instead,
just apply the transaction immediately

Test: HW Rendering app can remove SV
Fixes: 205924676
Change-Id: Ia6adb6dbad0238c4d815c72efc9b73bf4ea9c84a
This commit is contained in:
chaviw
2021-11-16 10:51:24 -06:00
parent 525dec66cc
commit ad9c0d7a55

View File

@@ -208,13 +208,13 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.function.Consumer;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Queue;
import java.util.concurrent.CountDownLatch;
import java.util.function.Consumer;
/**
* The top of a view hierarchy, implementing the needed protocol between View
@@ -10518,7 +10518,7 @@ public final class ViewRootImpl implements ViewParent,
@Override
public boolean applyTransactionOnDraw(@NonNull SurfaceControl.Transaction t) {
if (mRemoved) {
if (mRemoved || !isHardwareEnabled()) {
t.apply();
} else {
registerRtFrameCallback(frame -> mergeWithNextTransaction(t, frame));