Skip to content
Commit 0535832c authored by Mohamed Heikal's avatar Mohamed Heikal Committed by Commit Bot
Browse files

[Android] Fix flicker due to delayed attachment of SurfaceView

SurfaceView(s) used by the CompositorSurfaceManagerImpl are normally
attached during the inflation of the CompositorView. Normally that is
before the first draw of the application window happens (in
Activity#OnCreate). However, if the inflation is delayed (if it happens
on a background thread), this means that the SurfaceView is attached
after a draw event has occurred.

At the time of the first attach of a SurfaceView to the view hierarchy
(regardless of the SurfaceView's actual opacity), the window
transparency hint changes (because the window creates a transparent hole
and attaches the SurfaceView to that hole). This may cause older android
versions to destroy the window and redraw it causing a flicker. This one
line CL sets the window transparency hint early so that when the
SurfaceView gets attached later, the transparency hint need not change
and no flickering occurs.

Also removes misleading comments added earlier when this bug was not understood
well enough.

Bug: 855888,704866
Change-Id: If213b238a708fe1da5fce7808b0ec2e8cec4998a
Reviewed-on: https://chromium-review.googlesource.com/1125288


Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572618}
parent 4b347210
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment