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

Unified Diff: cc/layers/layer.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.h
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 3452e8b157b6b63477b20ff69b27deca5f8ee018..f56d55336858a25b3c7c222011ebf1f44adb9458 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -29,6 +29,7 @@
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkXfermode.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"
@@ -261,9 +262,9 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
return draw_properties_.num_unclipped_descendants;
}
- void SetScrollOffset(gfx::Vector2d scroll_offset);
- gfx::Vector2d scroll_offset() const { return scroll_offset_; }
- void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset);
+ void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
+ gfx::ScrollOffset scroll_offset() const { return scroll_offset_; }
+ void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset);
void SetScrollClipLayerId(int clip_layer_id);
bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; }
@@ -312,7 +313,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
gfx::Vector2d ScrollDelta() const { return gfx::Vector2d(); }
danakj 2014/09/25 15:13:30 This is Vector2dF on the impl side, can you make t
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 Done.
gfx::Vector2dF TotalScrollOffset() const {
danakj 2014/09/25 15:13:30 TODO to change this return type to ScrollOffset?
Yufeng Shen (Slow to review) 2014/09/25 20:06:23 let me do this in this patch
// Floating point to match the LayerImpl version.
- return scroll_offset() + ScrollDelta();
+ return gfx::ToVector2dF(scroll_offset()) + ScrollDelta();
}
void SetDoubleSided(bool double_sided);
@@ -584,7 +585,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// Layer properties.
gfx::Size bounds_;
- gfx::Vector2d scroll_offset_;
+ gfx::ScrollOffset scroll_offset_;
// This variable indicates which ancestor layer (if any) whose size,
// transformed relative to this layer, defines the maximum scroll offset for
// this layer.

Powered by Google App Engine
This is Rietveld 408576698