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

Unified Diff: android_webview/native/aw_contents.cc

Issue 1251323002: Plumb smooth scrolling in Chromium compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 5 years, 3 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 | « android_webview/native/aw_contents.h ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 10c21da3a47d0c8cee5db8a275cf13124b789173..806fe967ea18e1f2cf2fbebec21f6976afc6e0fa 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -1066,6 +1066,19 @@ void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint x, jint y) {
browser_view_renderer_.ScrollTo(gfx::Vector2d(x, y));
}
+void AwContents::SmoothScroll(JNIEnv* env,
+ jobject obj,
+ jint target_x,
+ jint target_y,
+ jlong duration_ms) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ float scale = browser_view_renderer_.dip_scale() *
+ browser_view_renderer_.page_scale_factor();
+ render_view_host_ext_->SmoothScroll(target_x / scale, target_y / scale,
+ duration_ms);
+}
+
void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
JNIEnv* env = AttachCurrentThread();
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698