[Android WebView] Handle clip size smaller than visible rect
commit8557ad7867ac9de4c76168bd35f7167f316145c2
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 3 Aug 2013 03:24:22 +0000 (3 03:24 +0000)
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 3 Aug 2013 03:24:22 +0000 (3 03:24 +0000)
treedb340bf38cd807c09ff51a239b19037217a9a2f2
parent215c59d19b17255bc719beb8c1c07b58652f40a9
[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
android_webview/browser/browser_view_renderer.h
android_webview/browser/in_process_view_renderer.cc
android_webview/browser/in_process_view_renderer.h
android_webview/java/src/org/chromium/android_webview/AwContents.java
android_webview/native/aw_contents.cc
android_webview/native/aw_contents.h