summaryrefslogtreecommitdiffstats
path: root/cc/layer_impl.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 20:46:13 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 20:46:13 +0000
commitc9c1ebe24790fb34fa9f0704b7963cea511c6f2a (patch)
treefdd43e025e44ae4d9515ebe03a3e4c54f7133d51 /cc/layer_impl.h
parent6e3d7e7d274a3e8347e49910ab6f873f37e15989 (diff)
downloadchromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.zip
chromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.tar.gz
chromium_src-c9c1ebe24790fb34fa9f0704b7963cea511c6f2a.tar.bz2
cc: Remove all remaining use of WebCore Rect/Point/Size types from the compositor.
This change removes all IntPoint/FloatRect/IntSize/etc from the compositor. There remains an indirect dependency on these types through the WebCore::Region class, which we wrap but need to replace. However, the wrapper there hides the WebCore types inside it, so there are now no references to the types from anywhere else in the compositor. I went back and forth on how to deal with scroll "positions". The name suggested that they should be Points, and that the deltas should be Vectors. However this lent itself to super awkward math at times. In the end, it was much cleaner to make all scroll "positions" into scroll "offsets" and represent everything as Vectors. Covered by existing tests; no change in behaviour. R=enne BUG=147395 Relanding: https://codereview.chromium.org/11367080/ Review URL: https://codereview.chromium.org/11366089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_impl.h')
-rw-r--r--cc/layer_impl.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/cc/layer_impl.h b/cc/layer_impl.h
index d51f3d0..c467d82 100644
--- a/cc/layer_impl.h
+++ b/cc/layer_impl.h
@@ -7,8 +7,6 @@
#include <string>
-#include "FloatSize.h"
-#include "IntPoint.h"
#include "Region.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -187,23 +185,23 @@ public:
float contentsScaleY() const { return m_contentsScaleY; }
void setContentsScale(float contentsScaleX, float contentsScaleY);
- const IntPoint& scrollPosition() const { return m_scrollPosition; }
- void setScrollPosition(const IntPoint&);
+ gfx::Vector2d scrollOffset() const { return m_scrollOffset; }
+ void setScrollOffset(gfx::Vector2d);
- const IntSize& maxScrollPosition() const {return m_maxScrollPosition; }
- void setMaxScrollPosition(const IntSize&);
+ gfx::Vector2d maxScrollOffset() const {return m_maxScrollOffset; }
+ void setMaxScrollOffset(gfx::Vector2d);
- const FloatSize& scrollDelta() const { return m_scrollDelta; }
- void setScrollDelta(const FloatSize&);
+ const gfx::Vector2dF& scrollDelta() const { return m_scrollDelta; }
+ void setScrollDelta(const gfx::Vector2dF&);
const WebKit::WebTransformationMatrix& implTransform() const { return m_implTransform; }
void setImplTransform(const WebKit::WebTransformationMatrix& transform);
- const IntSize& sentScrollDelta() const { return m_sentScrollDelta; }
- void setSentScrollDelta(const IntSize& sentScrollDelta) { m_sentScrollDelta = sentScrollDelta; }
+ const gfx::Vector2d& sentScrollDelta() const { return m_sentScrollDelta; }
+ void setSentScrollDelta(const gfx::Vector2d& sentScrollDelta) { m_sentScrollDelta = sentScrollDelta; }
// Returns the delta of the scroll that was outside of the bounds of the initial scroll
- FloatSize scrollBy(const FloatSize& scroll);
+ gfx::Vector2dF scrollBy(const gfx::Vector2dF& scroll);
bool scrollable() const { return m_scrollable; }
void setScrollable(bool scrollable) { m_scrollable = scrollable; }
@@ -316,7 +314,7 @@ private:
gfx::Size m_contentBounds;
float m_contentsScaleX;
float m_contentsScaleY;
- IntPoint m_scrollPosition;
+ gfx::Vector2d m_scrollOffset;
bool m_scrollable;
bool m_shouldScrollOnMainThread;
bool m_haveWheelEventHandlers;
@@ -356,9 +354,9 @@ private:
// This is true if the layer should be fixed to the closest ancestor container.
bool m_fixedToContainerLayer;
- FloatSize m_scrollDelta;
- IntSize m_sentScrollDelta;
- IntSize m_maxScrollPosition;
+ gfx::Vector2dF m_scrollDelta;
+ gfx::Vector2d m_sentScrollDelta;
+ gfx::Vector2d m_maxScrollOffset;
WebKit::WebTransformationMatrix m_implTransform;
// The layer whose coordinate space this layer draws into. This can be