diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-05 16:56:49 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-05 16:56:49 +0000 |
commit | ec454716d4056ddc796788b0cab45ec99b16113b (patch) | |
tree | c12de89ddf61012d1d5eb7f8c8573773a9215f5a /cc/layer_impl.h | |
parent | 992359d7cb13821cbc9cbf76d3e870860dea760d (diff) | |
download | chromium_src-ec454716d4056ddc796788b0cab45ec99b16113b.zip chromium_src-ec454716d4056ddc796788b0cab45ec99b16113b.tar.gz chromium_src-ec454716d4056ddc796788b0cab45ec99b16113b.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
Review URL: https://codereview.chromium.org/11367080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165947 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_impl.h')
-rw-r--r-- | cc/layer_impl.h | 28 |
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 |