[Android WebView] Handle clip size smaller than visible rect
The issue here is that compositor assumes every draw to match the
viewport exactly, and thus the whole viewport is updated each
draw. But we could be asked to draw a subset of the visible
rect, so there is a mismatch between what is really drawn and
what compositor assume is drawn.
Simple damage tracking inside compositor will not work for
webview because of all the other ways the view could be drawn.
Here is a simple fix. Whenever webview is asked to draw a subset
of the visible rect, invalidate the whole visible rect, regardless
of whether the compositor needs draws.
The assumption here is that the problem only manifests if we draw
a subset of the visible rect, so simply ensure the whole visible
rect drawn is immediately after. Ideally it should only be done if
we can detect the case of mismatch between compositor and what is
drawn, but this requires damage tracking and work through all the
different ways we can draw.
New in reland:
Always query the global visible rect each time it is needed since
the original listener does not always fire when it changes.
BUG=264275
NOTRY=true
Previously committed at r214727
Review URL: https://chromiumcodereview.appspot.com/
21191002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215474 0039d316-1c4b-4281-b951-d872f2087c98