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

Unified Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link crbug to TODO Created 6 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 | « content/browser/android/in_process/synchronous_compositor_impl.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/in_process/synchronous_compositor_impl.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc
index 66ce2cc14d47618013631c7fa60ead9adc8e7265..702164b5a8fcefc139ed4ea4b00d57e9dbec8071 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -256,11 +256,15 @@ void SynchronousCompositorImpl::DidActivatePendingTree() {
compositor_client_->DidUpdateContent();
}
-gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() {
+gfx::ScrollOffset SynchronousCompositorImpl::GetTotalScrollOffset() {
DCHECK(CalledOnValidThread());
- if (compositor_client_)
- return compositor_client_->GetTotalRootLayerScrollOffset();
- return gfx::Vector2dF();
+ if (compositor_client_) {
+ // TODO(miletus): Make GetTotalRootLayerScrollOffset return
+ // ScrollOffset. crbug.com/414283.
+ return gfx::ScrollOffset(
+ compositor_client_->GetTotalRootLayerScrollOffset());
+ }
+ return gfx::ScrollOffset();
}
bool SynchronousCompositorImpl::IsExternalFlingActive() const {
@@ -271,8 +275,8 @@ bool SynchronousCompositorImpl::IsExternalFlingActive() const {
}
void SynchronousCompositorImpl::UpdateRootLayerState(
- const gfx::Vector2dF& total_scroll_offset,
- const gfx::Vector2dF& max_scroll_offset,
+ const gfx::ScrollOffset& total_scroll_offset,
+ const gfx::ScrollOffset& max_scroll_offset,
const gfx::SizeF& scrollable_size,
float page_scale_factor,
float min_page_scale_factor,
@@ -281,12 +285,14 @@ void SynchronousCompositorImpl::UpdateRootLayerState(
if (!compositor_client_)
return;
- compositor_client_->UpdateRootLayerState(total_scroll_offset,
- max_scroll_offset,
- scrollable_size,
- page_scale_factor,
- min_page_scale_factor,
- max_page_scale_factor);
+ // TODO(miletus): Pass in ScrollOffset. crbug.com/414283.
+ compositor_client_->UpdateRootLayerState(
+ gfx::ScrollOffsetToVector2dF(total_scroll_offset),
+ gfx::ScrollOffsetToVector2dF(max_scroll_offset),
+ scrollable_size,
+ page_scale_factor,
+ min_page_scale_factor,
+ max_page_scale_factor);
}
// Not using base::NonThreadSafe as we want to enforce a more exacting threading
« no previous file with comments | « content/browser/android/in_process/synchronous_compositor_impl.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698