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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2242613003: Hoist SetNeedsBeginFrame messages up to the RWHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix redundant set needs begin frames Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 374 }
375 375
376 bool RenderWidgetHostViewAndroid::OnMessageReceived( 376 bool RenderWidgetHostViewAndroid::OnMessageReceived(
377 const IPC::Message& message) { 377 const IPC::Message& message) {
378 if (IPC_MESSAGE_ID_CLASS(message.type()) == SyncCompositorMsgStart) { 378 if (IPC_MESSAGE_ID_CLASS(message.type()) == SyncCompositorMsgStart) {
379 return SyncCompositorOnMessageReceived(message); 379 return SyncCompositorOnMessageReceived(message);
380 } 380 }
381 bool handled = true; 381 bool handled = true;
382 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) 382 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message)
383 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) 383 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent)
384 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames,
385 OnSetNeedsBeginFrames)
386 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, 384 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted,
387 OnSmartClipDataExtracted) 385 OnSmartClipDataExtracted)
388 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded, 386 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded,
389 OnShowUnhandledTapUIIfNeeded) 387 OnShowUnhandledTapUIIfNeeded)
390 IPC_MESSAGE_UNHANDLED(handled = false) 388 IPC_MESSAGE_UNHANDLED(handled = false)
391 IPC_END_MESSAGE_MAP() 389 IPC_END_MESSAGE_MAP()
392 return handled; 390 return handled;
393 } 391 }
394 392
395 bool RenderWidgetHostViewAndroid::SyncCompositorOnMessageReceived( 393 bool RenderWidgetHostViewAndroid::SyncCompositorOnMessageReceived(
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 657
660 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) { 658 void RenderWidgetHostViewAndroid::UpdateBackgroundColor(SkColor color) {
661 if (cached_background_color_ == color) 659 if (cached_background_color_ == color)
662 return; 660 return;
663 661
664 cached_background_color_ = color; 662 cached_background_color_ = color;
665 if (content_view_core_) 663 if (content_view_core_)
666 content_view_core_->OnBackgroundColorChanged(color); 664 content_view_core_->OnBackgroundColorChanged(color);
667 } 665 }
668 666
669 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) { 667 void RenderWidgetHostViewAndroid::SetNeedsBeginFrames(bool needs_begin_frames) {
670 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames", 668 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SetNeedsBeginFrames",
671 "enabled", enabled); 669 "needs_begin_frames", needs_begin_frames);
672 if (enabled) 670 if (needs_begin_frames)
673 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); 671 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME);
674 else 672 else
675 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; 673 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME;
676 } 674 }
677 675
678 void RenderWidgetHostViewAndroid::OnStartContentIntent( 676 void RenderWidgetHostViewAndroid::OnStartContentIntent(
679 const GURL& content_url, bool is_main_frame) { 677 const GURL& content_url, bool is_main_frame) {
680 if (content_view_core_) 678 if (content_view_core_)
681 content_view_core_->StartContentIntent(content_url, is_main_frame); 679 content_view_core_->StartContentIntent(content_url, is_main_frame);
682 } 680 }
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 case ui::MotionEvent::ACTION_UP: 1972 case ui::MotionEvent::ACTION_UP:
1975 case ui::MotionEvent::ACTION_POINTER_UP: 1973 case ui::MotionEvent::ACTION_POINTER_UP:
1976 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 1974 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1977 delta.InMicroseconds(), 1, 1000000, 50); 1975 delta.InMicroseconds(), 1, 1000000, 50);
1978 default: 1976 default:
1979 return; 1977 return;
1980 } 1978 }
1981 } 1979 }
1982 1980
1983 } // namespace content 1981 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698