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

Commit 883e2979 authored by John Reck's avatar John Reck
Browse files

Remove the thread-unsafe destroyHardwareResources in VRI#die

Bug: 377057106
Test: none
Flag: com.android.graphics.hwui.flags.remove_vri_sketchy_destroy
Change-Id: Ib7c0aa8cd0c8e3bff9da4c566de71b24eb4c46f5
parent ea0378dc
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -9952,11 +9952,13 @@ public final class ViewRootImpl implements ViewParent,
            return false;
            return false;
        }
        }
        if (!com.android.graphics.hwui.flags.Flags.removeVriSketchyDestroy()) {
            if (!mIsDrawing) {
            if (!mIsDrawing) {
                destroyHardwareRenderer();
                destroyHardwareRenderer();
            } else {
            } else {
            Log.e(mTag, "Attempting to destroy the window while drawing!\n" +
                Log.e(mTag, "Attempting to destroy the window while drawing!\n"
                    "  window=" + this + ", title=" + mWindowAttributes.getTitle());
                        + "  window=" + this + ", title=" + mWindowAttributes.getTitle());
            }
        }
        }
        mHandler.sendEmptyMessage(MSG_DIE);
        mHandler.sendEmptyMessage(MSG_DIE);
        return true;
        return true;
@@ -9977,9 +9979,9 @@ public final class ViewRootImpl implements ViewParent,
                dispatchDetachedFromWindow();
                dispatchDetachedFromWindow();
            }
            }
            if (mAdded && !mFirst) {
            destroyHardwareRenderer();
            destroyHardwareRenderer();
            if (mAdded && !mFirst) {
                if (mView != null) {
                if (mView != null) {
                    int viewVisibility = mView.getVisibility();
                    int viewVisibility = mView.getVisibility();
                    boolean viewVisibilityChanged = mViewVisibility != viewVisibility;
                    boolean viewVisibilityChanged = mViewVisibility != viewVisibility;
+10 −0
Original line number Original line Diff line number Diff line
@@ -154,3 +154,13 @@ flag {
  description: "API's that enable animated image drawables to use nearest sampling when scaling."
  description: "API's that enable animated image drawables to use nearest sampling when scaling."
  bug: "370523334"
  bug: "370523334"
}
}

flag {
  name: "remove_vri_sketchy_destroy"
  namespace: "core_graphics"
  description: "Remove the eager yet thread-violating destroyHardwareResources in VRI#die"
  bug: "377057106"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
 No newline at end of file