Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2079)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 457913002: Android WebView: flush input events during onVSync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixups Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 8338559035220c8762571e0d4a9627c13eeb1464..9770b3f1fc7f12545967dce7b351c7e9a9ffbc82 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -87,6 +87,8 @@ public class AwContents {
// produce little visible difference.
private static final float ZOOM_CONTROLS_EPSILON = 0.007f;
+ private WindowAndroid mWindowAndroid;
+
/**
* WebKit hit test related data strcutre. These are used to implement
* getHitTestResult, requestFocusNodeHref, requestImageRef methods in WebView.
@@ -614,12 +616,11 @@ public class AwContents {
Context context, InternalAccessDelegate internalDispatcher, long nativeWebContents,
GestureStateListener gestureStateListener,
ContentViewClient contentViewClient,
- ContentViewCore.ZoomControlsDelegate zoomControlsDelegate) {
+ ContentViewCore.ZoomControlsDelegate zoomControlsDelegate,
+ WindowAndroid windowAndroid) {
ContentViewCore contentViewCore = new ContentViewCore(context);
contentViewCore.initialize(containerView, internalDispatcher, nativeWebContents,
- context instanceof Activity ?
- new ActivityWindowAndroid((Activity) context) :
- new WindowAndroid(context.getApplicationContext()));
+ windowAndroid);
contentViewCore.addGestureStateListener(gestureStateListener);
contentViewCore.setContentViewClient(contentViewClient);
contentViewCore.setZoomControlsDelegate(zoomControlsDelegate);
@@ -755,9 +756,13 @@ public class AwContents {
mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents));
long nativeWebContents = nativeGetWebContents(mNativeAwContents);
+
+ mWindowAndroid = mContext instanceof Activity ?
+ new ActivityWindowAndroid((Activity) mContext) :
+ new WindowAndroid(mContext.getApplicationContext());
boliu 2014/08/20 20:30:00 Move this into createAndInitializeContentViewCore.
hush (inactive) 2014/08/20 21:01:09 createAndInitializeContentViewCore is a static met
mContentViewCore = createAndInitializeContentViewCore(
mContainerView, mContext, mInternalAccessAdapter, nativeWebContents,
- new AwGestureStateListener(), mContentViewClient, mZoomControls);
+ new AwGestureStateListener(), mContentViewClient, mZoomControls, mWindowAndroid);
nativeSetJavaPeers(mNativeAwContents, this, mWebContentsDelegate, mContentsClientBridge,
mIoThreadClient, mInterceptNavigationDelegate);
installWebContentsObserver();
@@ -2039,10 +2044,10 @@ public class AwContents {
@CalledByNative
private void postInvalidateOnAnimation() {
- if (SUPPORTS_ON_ANIMATION) {
+ if (SUPPORTS_ON_ANIMATION && !mWindowAndroid.isInsideVSync()) {
mContainerView.postInvalidateOnAnimation();
} else {
- mContainerView.postInvalidate();
+ mContainerView.invalidate();
}
}

Powered by Google App Engine
This is Rietveld 408576698