diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 18:15:58 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 18:15:58 +0000 |
commit | aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53 (patch) | |
tree | 24c9af166977bbf8f25aa5b129defb35f3f8ec05 /cc/layer_impl.h | |
parent | 33432d8c37e3b929c60097c1eb7a53b13f364fb5 (diff) | |
download | chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.zip chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.gz chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.bz2 |
cc: Use gfx:: Geometry types for positions, bounds, and related things.
This covers layers, layer tree hosts, and related classes. *phew*
I intentionally avoided anything to do with scrolling or page scale. Those
should be changed to be Vectors and need a bit more thought. This change
should be pretty mindless.
It converts to gfx Rect, Size, Vector, and Point classes. No change is
made for FloatPoint3D or FloatQuad yet.
I've added cc/geometry.h as a place for free functions that don't exist
on gfx types yet, and that we should port over in the future.
No change in behaviour; covered by existing tests.
BUG=147395
R=enne
Review URL: https://codereview.chromium.org/11264056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_impl.h')
-rw-r--r-- | cc/layer_impl.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/cc/layer_impl.h b/cc/layer_impl.h index f1fae67..3b59e12 100644 --- a/cc/layer_impl.h +++ b/cc/layer_impl.h @@ -5,8 +5,6 @@ #ifndef CCLayerImpl_h #define CCLayerImpl_h -#include "FloatRect.h" -#include "IntRect.h" #include "Region.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -18,6 +16,8 @@ #include "cc/scoped_ptr_vector.h" #include "cc/shared_quad_state.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/gfx/rect.h" +#include "ui/gfx/rect_f.h" #include <public/WebFilterOperations.h> #include <public/WebTransformationMatrix.h> #include <string> @@ -95,8 +95,8 @@ public: // Returns true if any of the layer's descendants has content to draw. virtual bool descendantDrawsContent(); - void setAnchorPoint(const FloatPoint&); - const FloatPoint& anchorPoint() const { return m_anchorPoint; } + void setAnchorPoint(const gfx::PointF&); + const gfx::PointF& anchorPoint() const { return m_anchorPoint; } void setAnchorPointZ(float); float anchorPointZ() const { return m_anchorPointZ; } @@ -122,8 +122,8 @@ public: void setOpacity(float); bool opacityIsAnimating() const; - void setPosition(const FloatPoint&); - const FloatPoint& position() const { return m_position; } + void setPosition(const gfx::PointF&); + const gfx::PointF& position() const { return m_position; } void setIsContainerForFixedPositionLayers(bool isContainerForFixedPositionLayers) { m_isContainerForFixedPositionLayers = isContainerForFixedPositionLayers; } bool isContainerForFixedPositionLayers() const { return m_isContainerForFixedPositionLayers; } @@ -171,13 +171,13 @@ public: // contentsScale to appropriate values. LayerImpl doesn't calculate any of // them from the other values. - void setBounds(const IntSize&); - const IntSize& bounds() const { return m_bounds; } + void setBounds(const gfx::Size&); + const gfx::Size& bounds() const { return m_bounds; } // ContentBounds may be [0, 1) pixels larger than bounds * contentsScale. // Don't calculate scale from it. Use contentsScale instead for accuracy. - void setContentBounds(const IntSize&); - IntSize contentBounds() const { return m_contentBounds; } + void setContentBounds(const gfx::Size&); + gfx::Size contentBounds() const { return m_contentBounds; } float contentsScaleX() const { return m_contentsScaleX; } float contentsScaleY() const { return m_contentsScaleY; } @@ -218,8 +218,8 @@ public: InputHandlerClient::ScrollStatus tryScroll(const IntPoint& viewportPoint, InputHandlerClient::ScrollInputType) const; - const IntRect& visibleContentRect() const { return m_visibleContentRect; } - void setVisibleContentRect(const IntRect& visibleContentRect) { m_visibleContentRect = visibleContentRect; } + const gfx::Rect& visibleContentRect() const { return m_visibleContentRect; } + void setVisibleContentRect(const gfx::Rect& visibleContentRect) { m_visibleContentRect = visibleContentRect; } bool doubleSided() const { return m_doubleSided; } void setDoubleSided(bool); @@ -237,10 +237,10 @@ public: bool screenSpaceTransformIsAnimating() const { return m_screenSpaceTransformIsAnimating; } void setScreenSpaceTransformIsAnimating(bool animating) { m_screenSpaceTransformIsAnimating = animating; } - const IntRect& drawableContentRect() const { return m_drawableContentRect; } - void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = rect; } - const FloatRect& updateRect() const { return m_updateRect; } - void setUpdateRect(const FloatRect& updateRect) { m_updateRect = updateRect; } + const gfx::Rect& drawableContentRect() const { return m_drawableContentRect; } + void setDrawableContentRect(const gfx::Rect& rect) { m_drawableContentRect = rect; } + const gfx::RectF& updateRect() const { return m_updateRect; } + void setUpdateRect(const gfx::RectF& updateRect) { m_updateRect = updateRect; } std::string layerTreeAsText() const; @@ -270,7 +270,7 @@ public: ScrollbarLayerImpl* verticalScrollbarLayer() const; void setVerticalScrollbarLayer(ScrollbarLayerImpl*); - IntRect layerRectToContentRect(const FloatRect& layerRect) const; + gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; protected: explicit LayerImpl(int); @@ -306,10 +306,10 @@ private: LayerTreeHostImpl* m_layerTreeHostImpl; // Properties synchronized from the associated Layer. - FloatPoint m_anchorPoint; + gfx::PointF m_anchorPoint; float m_anchorPointZ; - IntSize m_bounds; - IntSize m_contentBounds; + gfx::Size m_bounds; + gfx::Size m_contentBounds; float m_contentsScaleX; float m_contentsScaleY; IntPoint m_scrollPosition; @@ -332,11 +332,11 @@ private: bool m_layerSurfacePropertyChanged; // Uses layer's content space. - IntRect m_visibleContentRect; + gfx::Rect m_visibleContentRect; bool m_masksToBounds; bool m_contentsOpaque; float m_opacity; - FloatPoint m_position; + gfx::PointF m_position; bool m_preserves3D; bool m_useParentBackfaceVisibility; bool m_drawCheckerboardForMissingTiles; @@ -394,12 +394,12 @@ private: // Hierarchical bounding rect containing the layer and its descendants. // Uses target surface's space. - IntRect m_drawableContentRect; + gfx::Rect m_drawableContentRect; // Rect indicating what was repainted/updated during update. // Note that plugin layers bypass this and leave it empty. // Uses layer's content space. - FloatRect m_updateRect; + gfx::RectF m_updateRect; // Manages animations for this layer. scoped_ptr<LayerAnimationController> m_layerAnimationController; |