Commit 327ac132 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

CC: Use a reference-to-const for ApplyViewportDeltas and RecordWheelAndTouchScrollingCount in LTH

ApplyViewportDeltas and RecordWheelAndTouchScrollingCount have been using a raw pointer type
for the argument. It would be good if we can use const T& for the arguments if possible.

Bug: None
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibdcbc5cd3ebe95cce743b2ffcc84b7dc009a0044
Reviewed-on: https://chromium-review.googlesource.com/1227861Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Cr-Commit-Position: refs/heads/master@{#592020}
parent d1954f5b
......@@ -869,13 +869,13 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
return did_paint_content;
}
void LayerTreeHost::ApplyViewportDeltas(ScrollAndScaleSet* info) {
void LayerTreeHost::ApplyViewportDeltas(const ScrollAndScaleSet& info) {
gfx::Vector2dF inner_viewport_scroll_delta;
if (info->inner_viewport_scroll.element_id)
inner_viewport_scroll_delta = info->inner_viewport_scroll.scroll_delta;
if (info.inner_viewport_scroll.element_id)
inner_viewport_scroll_delta = info.inner_viewport_scroll.scroll_delta;
if (inner_viewport_scroll_delta.IsZero() && info->page_scale_delta == 1.f &&
info->elastic_overscroll_delta.IsZero() && !info->top_controls_delta)
if (inner_viewport_scroll_delta.IsZero() && info.page_scale_delta == 1.f &&
info.elastic_overscroll_delta.IsZero() && !info.top_controls_delta)
return;
// Preemptively apply the scroll offset and scale delta here before sending
......@@ -888,21 +888,21 @@ void LayerTreeHost::ApplyViewportDeltas(ScrollAndScaleSet* info) {
inner_viewport_scroll_delta));
}
ApplyPageScaleDeltaFromImplSide(info->page_scale_delta);
ApplyPageScaleDeltaFromImplSide(info.page_scale_delta);
SetElasticOverscrollFromImplSide(elastic_overscroll_ +
info->elastic_overscroll_delta);
info.elastic_overscroll_delta);
// TODO(ccameron): pass the elastic overscroll here so that input events
// may be translated appropriately.
client_->ApplyViewportDeltas(inner_viewport_scroll_delta, gfx::Vector2dF(),
info->elastic_overscroll_delta,
info->page_scale_delta,
info->top_controls_delta);
info.elastic_overscroll_delta,
info.page_scale_delta, info.top_controls_delta);
SetNeedsUpdateLayers();
}
void LayerTreeHost::RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info) {
bool has_scrolled_by_wheel = info->has_scrolled_by_wheel;
bool has_scrolled_by_touch = info->has_scrolled_by_touch;
void LayerTreeHost::RecordWheelAndTouchScrollingCount(
const ScrollAndScaleSet& info) {
bool has_scrolled_by_wheel = info.has_scrolled_by_wheel;
bool has_scrolled_by_touch = info.has_scrolled_by_touch;
if (has_scrolled_by_wheel || has_scrolled_by_touch) {
client_->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel,
......@@ -911,6 +911,7 @@ void LayerTreeHost::RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info) {
}
void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
DCHECK(info);
for (auto& swap_promise : info->swap_promises) {
TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow",
TRACE_ID_DONT_MANGLE(swap_promise->TraceId()),
......@@ -939,9 +940,9 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
// This needs to happen after scroll deltas have been sent to prevent top
// controls from clamping the layout viewport both on the compositor and
// on the main thread.
ApplyViewportDeltas(info);
ApplyViewportDeltas(*info);
RecordWheelAndTouchScrollingCount(info);
RecordWheelAndTouchScrollingCount(*info);
}
const base::WeakPtr<InputHandler>& LayerTreeHost::GetInputHandler()
......
......@@ -646,8 +646,8 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
// free of slow-paths before toggling the flag.
enum { kNumFramesToConsiderBeforeRemovingSlowPathFlag = 60 };
void ApplyViewportDeltas(ScrollAndScaleSet* info);
void RecordWheelAndTouchScrollingCount(ScrollAndScaleSet* info);
void ApplyViewportDeltas(const ScrollAndScaleSet& info);
void RecordWheelAndTouchScrollingCount(const ScrollAndScaleSet& info);
void ApplyPageScaleDeltaFromImplSide(float page_scale_delta);
void InitializeProxy(std::unique_ptr<Proxy> proxy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment