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

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

Issue 470523006: Add an "isInsideVSync" check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/VSyncMonitor.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e556de8b69aa1aa0cc81032fccebf929b901988f 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -181,6 +181,7 @@ public class AwContents {
private final AwLayoutChangeListener mLayoutChangeListener;
private final Context mContext;
private ContentViewCore mContentViewCore;
+ private WindowAndroid mWindowAndroid;
private final AwContentsClient mContentsClient;
private final AwContentViewClient mContentViewClient;
private WebContentsObserverAndroid mWebContentsObserver;
@@ -614,12 +615,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 +755,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());
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 +2043,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();
}
}
« no previous file with comments | « no previous file | ui/android/java/src/org/chromium/ui/VSyncMonitor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698