Skip to content

Commit

Permalink
Make the virtual display's window translucent (flutter#9828)
Browse files Browse the repository at this point in the history
By default alpha is not preserved for the VD's contents.
We make the window translucent as a side effect of doing so is preserving alpha.
There should not be extra performance cost for setting the window to be translucent as there is only a single window within the VD.

Fixes flutter/flutter#33756
  • Loading branch information
amirh authored Jul 15, 2019
1 parent bf91bdb commit 74af88b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ public SingleViewPresentation(
Object createParams,
OnFocusChangeListener focusChangeListener
) {
super(outerContext, display);
// By default alpha is not preserved for the VD's contents.
// We make the window translucent as a side effect of doing so is preserving alpha.
// There should not be extra performance cost for setting the window to be translucent as
// there is only a single window within the VD.
super(outerContext, display, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
this.viewFactory = viewFactory;
this.accessibilityEventsDelegate = accessibilityEventsDelegate;
this.viewId = viewId;
Expand All @@ -109,6 +113,7 @@ public SingleViewPresentation(
);
}


/**
* Creates a presentation that will attach an already existing view as
* its root view.
Expand All @@ -124,7 +129,11 @@ public SingleViewPresentation(
OnFocusChangeListener focusChangeListener,
boolean startFocused
) {
super(outerContext, display);
// By default alpha is not preserved for the VD's contents.
// We make the window translucent as a side effect of doing so is preserving alpha.
// There should not be extra performance cost for setting the window to be translucent as
// there is only a single window within the VD.
super(outerContext, display, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
this.accessibilityEventsDelegate = accessibilityEventsDelegate;
viewFactory = null;
this.state = state;
Expand Down

0 comments on commit 74af88b

Please sign in to comment.