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

Unified Diff: cc/layers/layer_impl.h

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_impl.h
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 65143ab514c386de3cc217c8f73cbd467dfab298..d9ebae8329b6f867cebc4489016913f464c17934 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -30,6 +30,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
+#include "ui/gfx/geometry/scroll_offset.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/rect_f.h"
@@ -376,10 +377,10 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate);
bool IsExternalFlingActive() const;
- void SetScrollOffset(const gfx::Vector2d& scroll_offset);
- void SetScrollOffsetAndDelta(const gfx::Vector2d& scroll_offset,
+ void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
+ void SetScrollOffsetAndDelta(const gfx::ScrollOffset& scroll_offset,
const gfx::Vector2dF& scroll_delta);
- gfx::Vector2d scroll_offset() const { return scroll_offset_; }
+ gfx::ScrollOffset scroll_offset() const { return scroll_offset_; }
gfx::Vector2d MaxScrollOffset() const;
danakj 2014/09/25 15:13:31 Should this and ClampScroll be ScrollOffsets?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
gfx::Vector2dF ClampScrollToMaxScrollOffset();
@@ -390,8 +391,8 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
gfx::Vector2dF TotalScrollOffset() const;
danakj 2014/09/25 15:13:31 TODO to change to ScrollOffset?
Yufeng Shen (Slow to review) 2014/09/25 20:06:24 done in this patch.
- void SetSentScrollDelta(const gfx::Vector2d& sent_scroll_delta);
- gfx::Vector2d sent_scroll_delta() const { return sent_scroll_delta_; }
+ void SetSentScrollDelta(const gfx::ScrollOffset& sent_scroll_delta);
danakj 2014/09/25 15:13:30 Why isn't the delta a Vector2dF? We should be con
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 right, I change all the scroll delta to Vector2dF,
+ gfx::ScrollOffset sent_scroll_delta() const { return sent_scroll_delta_; }
// Returns the delta of the scroll that was outside of the bounds of the
// initial scroll
@@ -606,7 +607,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
gfx::Point3F transform_origin_;
gfx::Size bounds_;
gfx::Vector2dF bounds_delta_;
- gfx::Vector2d scroll_offset_;
+ gfx::ScrollOffset scroll_offset_;
ScrollOffsetDelegate* scroll_offset_delegate_;
LayerImpl* scroll_clip_layer_;
bool scrollable_ : 1;
@@ -649,7 +650,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
LayerPositionConstraint position_constraint_;
gfx::Vector2dF scroll_delta_;
- gfx::Vector2d sent_scroll_delta_;
+ gfx::ScrollOffset sent_scroll_delta_;
danakj 2014/09/25 15:13:30 impl-side deltas are Vector2dF can this be that?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
gfx::Vector2dF last_scroll_offset_;
danakj 2014/09/25 15:13:31 shouldnt this be a ScrollOffset?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
int num_descendants_that_draw_content_;

Powered by Google App Engine
This is Rietveld 408576698