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

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

Issue 14577008: Disable vsync on input for webview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on ics Created 7 years, 7 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 | content/public/android/java/src/org/chromium/content/browser/ContentView.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 17bfdb5d1d2ac29b5e436d156161098e7d3e37d9..502d0dcca76b5f9e17c7fb58a850f525350e7c66 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -35,6 +35,7 @@ import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.ContentSettings;
import org.chromium.content.browser.ContentVideoView;
+import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.ContentViewStatics;
import org.chromium.content.browser.LoadUrlParams;
@@ -300,6 +301,22 @@ public class AwContents {
isAccessFromFileURLsGrantedByDefault, new AwLayoutSizer());
}
+ private static ContentViewCore createAndInitializeContentViewCore(ViewGroup containerView,
+ InternalAccessDelegate internalDispatcher, int nativeWebContents,
+ ContentViewCore.PinchGestureStateListener pinchGestureStateListener,
+ ContentViewClient contentViewClient,
+ ContentViewCore.ZoomControlsDelegate zoomControlsDelegate) {
+ ContentViewCore contentViewCore = new ContentViewCore(containerView.getContext());
+ // Note INPUT_EVENTS_DELIVERED_IMMEDIATELY is passed to avoid triggering vsync in the
+ // compositor, not because input events are delivered immediately.
+ contentViewCore.initialize(containerView, internalDispatcher, nativeWebContents, null,
+ ContentViewCore.INPUT_EVENTS_DELIVERED_IMMEDIATELY);
+ contentViewCore.setPinchGestureStateListener(pinchGestureStateListener);
+ contentViewCore.setContentViewClient(contentViewClient);
+ contentViewCore.setZoomControlsDelegate(zoomControlsDelegate);
+ return contentViewCore;
+ }
+
/**
* @param layoutSizer the AwLayoutSizer instance implementing the sizing policy for the view.
*
@@ -315,8 +332,6 @@ public class AwContents {
mDIPScale = DeviceDisplayInfo.create(containerView.getContext()).getDIPScale();
// Note that ContentViewCore must be set up before AwContents, as ContentViewCore
// setup performs process initialisation work needed by AwContents.
- mContentViewCore = new ContentViewCore(containerView.getContext());
- mContentViewCore.setPinchGestureStateListener(new AwPinchGestureStateListener());
mContentsClientBridge = new AwContentsClientBridge(contentsClient);
mLayoutSizer = layoutSizer;
mLayoutSizer.setDelegate(new AwLayoutSizerDelegate());
@@ -328,11 +343,11 @@ public class AwContents {
mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents));
int nativeWebContents = nativeGetWebContents(mNativeAwContents);
- mContentViewCore.initialize(
- containerView, internalAccessAdapter, nativeWebContents, null);
- mContentViewCore.setContentViewClient(mContentsClient.getContentViewClient());
mZoomControls = new AwZoomControls(this);
- mContentViewCore.setZoomControlsDelegate(mZoomControls);
+ mContentViewCore = createAndInitializeContentViewCore(
+ containerView, internalAccessAdapter, nativeWebContents,
+ new AwPinchGestureStateListener(), mContentsClient.getContentViewClient(),
+ mZoomControls);
mContentsClient.installWebContentsObserver(mContentViewCore);
mSettings = new AwSettings(mContentViewCore.getContext(), nativeWebContents,
@@ -576,10 +591,10 @@ public class AwContents {
private void setNewWebContents(int newWebContentsPtr) {
// When setting a new WebContents, we new up a ContentViewCore that will
// wrap it and then swap it.
- ContentViewCore newCore = new ContentViewCore(mContainerView.getContext());
- newCore.initialize(mContainerView, mInternalAccessAdapter, newWebContentsPtr, null);
- newCore.setContentViewClient(mContentsClient.getContentViewClient());
- newCore.setZoomControlsDelegate(mZoomControls);
+ ContentViewCore newCore = createAndInitializeContentViewCore(
+ mContainerView, mInternalAccessAdapter, newWebContentsPtr,
+ new AwPinchGestureStateListener(), mContentsClient.getContentViewClient(),
+ mZoomControls);
mContentsClient.installWebContentsObserver(newCore);
// Now swap the Java side reference.
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698