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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 11854013: Use input events to improve vsync scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't set last-input-for-vsync bit on pages with touch handlers. Created 7 years, 11 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: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 0f762944731ee56bbcf1defaac237a59869a80bd..1306f12e88c9e324f587b84a491a4e70517f7360 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -151,6 +151,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(JNIEnv* env, jobject obj,
root_layer_(cc::Layer::create()),
tab_crashed_(false),
input_events_delivered_at_vsync_(input_events_delivered_at_vsync),
+ has_touch_event_handlers_(false),
renderer_frame_pending_(false),
window_android_(window_android) {
CHECK(web_contents) <<
@@ -498,6 +499,7 @@ void ContentViewCoreImpl::ConfirmTouchEvent(InputEventAckState ack_result) {
void ContentViewCoreImpl::HasTouchEventHandlers(bool need_touch_events) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
+ has_touch_event_handlers_ = need_touch_events;
if (j_obj.is_null())
return;
Java_ContentViewCore_hasTouchEventHandlers(env,
@@ -866,11 +868,10 @@ WebGestureEvent ContentViewCoreImpl::MakeGestureEvent(WebInputEvent::Type type,
void ContentViewCoreImpl::UpdateVSyncFlagOnInputEvent(
WebKit::WebInputEvent* event) const {
- if (!input_events_delivered_at_vsync_)
+ if (!input_events_delivered_at_vsync_ || has_touch_event_handlers_)
return;
if (event->type == WebInputEvent::GestureScrollUpdate ||
- event->type == WebInputEvent::GesturePinchUpdate ||
- event->type == WebInputEvent::TouchMove)
jamesr 2013/01/16 04:13:26 whaaaa? why was this here? actually, this whole f
Sami 2013/01/16 10:49:15 From Android's point of view input events are alwa
+ event->type == WebInputEvent::GesturePinchUpdate)
event->modifiers |= WebInputEvent::IsLastInputEventForCurrentVSync;
}

Powered by Google App Engine
This is Rietveld 408576698