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

Unified Diff: cc/layers/layer.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ScrollOffset instead of vector2dF for scroll offset 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
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 1a22d9254a9b5bded9b1560c4769760efa57779d..e7e686669e9fa89aa3041ca8a08d81d665c75e65 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -654,7 +654,7 @@ void Layer::RemoveClipChild(Layer* child) {
SetNeedsCommit();
}
-void Layer::SetScrollOffset(gfx::Vector2d scroll_offset) {
+void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) {
DCHECK(IsPropertyChangeAllowed());
if (scroll_offset_ == scroll_offset)
@@ -663,7 +663,8 @@ void Layer::SetScrollOffset(gfx::Vector2d scroll_offset) {
SetNeedsCommit();
}
-void Layer::SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset) {
+void Layer::SetScrollOffsetFromImplSide(
+ const gfx::ScrollOffset& scroll_offset) {
DCHECK(IsPropertyChangeAllowed());
// This function only gets called during a BeginMainFrame, so there
// is no need to call SetNeedsUpdate here.
@@ -963,8 +964,9 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetScrollOffset(scroll_offset_);
} else {
layer->SetScrollOffsetAndDelta(
- scroll_offset_, layer->ScrollDelta() - layer->sent_scroll_delta());
- layer->SetSentScrollDelta(gfx::Vector2d());
+ scroll_offset_,
+ layer->ScrollDelta() - ToVector2dF(layer->sent_scroll_delta()));
+ layer->SetSentScrollDelta(gfx::ScrollOffset());
}
// Wrap the copy_requests_ in a PostTask to the main thread.

Powered by Google App Engine
This is Rietveld 408576698