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

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

Issue 1969263004: sync compositor: Remove begin frame source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase onto https://codereview.chromium.org/1974133002/ Created 4 years, 6 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 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 if (host_) 1455 if (host_)
1456 host_->Send(new ViewMsg_SetBeginFramePaused(host_->GetRoutingID(), true)); 1456 host_->Send(new ViewMsg_SetBeginFramePaused(host_->GetRoutingID(), true));
1457 content_view_core_->GetWindowAndroid()->RemoveObserver(this); 1457 content_view_core_->GetWindowAndroid()->RemoveObserver(this);
1458 } 1458 }
1459 1459
1460 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time, 1460 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time,
1461 base::TimeDelta vsync_period) { 1461 base::TimeDelta vsync_period) {
1462 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SendBeginFrame", 1462 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SendBeginFrame",
1463 "frame_time_us", frame_time.ToInternalValue()); 1463 "frame_time_us", frame_time.ToInternalValue());
1464 1464
1465 if (using_browser_compositor_) { 1465 // Synchronous compositor does not use deadline-based scheduling.
1466 // TODO(brianderson): Replace this hardcoded deadline after Android 1466 // TODO(brianderson): Replace this hardcoded deadline after Android
1467 // switches to Surfaces and the Browser's commit isn't in the critcal path. 1467 // switches to Surfaces and the Browser's commit isn't in the critcal path.
1468 base::TimeTicks deadline = frame_time + (vsync_period * 0.6); 1468 base::TimeTicks deadline =
1469 1469 sync_compositor_ ? base::TimeTicks() : frame_time + (vsync_period * 0.6);
1470 host_->Send(new ViewMsg_BeginFrame( 1470 host_->Send(new ViewMsg_BeginFrame(
1471 host_->GetRoutingID(), 1471 host_->GetRoutingID(),
1472 cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, frame_time, deadline, 1472 cc::BeginFrameArgs::Create(BEGINFRAME_FROM_HERE, frame_time, deadline,
1473 vsync_period, cc::BeginFrameArgs::NORMAL))); 1473 vsync_period, cc::BeginFrameArgs::NORMAL)));
1474 } else if (sync_compositor_) { 1474 if (sync_compositor_)
1475 // The synchronous compositor synchronously does it's work in this call. 1475 sync_compositor_->DidSendBeginFrame();
1476 // It does not use a deadline.
1477 sync_compositor_->BeginFrame(cc::BeginFrameArgs::Create(
1478 BEGINFRAME_FROM_HERE, frame_time, base::TimeTicks(), vsync_period,
1479 cc::BeginFrameArgs::NORMAL));
1480 }
1481 } 1476 }
1482 1477
1483 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { 1478 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) {
1484 bool needs_animate = false; 1479 bool needs_animate = false;
1485 if (overscroll_controller_) { 1480 if (overscroll_controller_) {
1486 needs_animate |= overscroll_controller_->Animate( 1481 needs_animate |= overscroll_controller_->Animate(
1487 frame_time, content_view_core_->GetLayer().get()); 1482 frame_time, content_view_core_->GetLayer().get());
1488 } 1483 }
1489 if (selection_controller_) 1484 if (selection_controller_)
1490 needs_animate |= selection_controller_->Animate(frame_time); 1485 needs_animate |= selection_controller_->Animate(frame_time);
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
2043 case ui::MotionEvent::ACTION_UP: 2038 case ui::MotionEvent::ACTION_UP:
2044 case ui::MotionEvent::ACTION_POINTER_UP: 2039 case ui::MotionEvent::ACTION_POINTER_UP:
2045 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 2040 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
2046 delta.InMicroseconds(), 1, 1000000, 50); 2041 delta.InMicroseconds(), 1, 1000000, 50);
2047 default: 2042 default:
2048 return; 2043 return;
2049 } 2044 }
2050 } 2045 }
2051 2046
2052 } // namespace content 2047 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/synchronous_compositor_host.cc ('k') | content/common/android/sync_compositor_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698