diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 23:02:38 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 23:02:38 +0000 |
commit | d0f98369e69763a2eeb7ea39097bf01ef234a39c (patch) | |
tree | 943e3e20a23e54d6de23d4007828a1d35c2bf6bf /cc/layer_tree_host_impl.cc | |
parent | 1140046f0868117776b6df7e7c99c5bf3dd23731 (diff) | |
download | chromium_src-d0f98369e69763a2eeb7ea39097bf01ef234a39c.zip chromium_src-d0f98369e69763a2eeb7ea39097bf01ef234a39c.tar.gz chromium_src-d0f98369e69763a2eeb7ea39097bf01ef234a39c.tar.bz2 |
Remove most remaining references to IntRect and FloatRect.
The remaining uses are:
- Dealing with the output of Region::rects() which gives a vector of
WebCore::IntRects.
- Using FloatRect::isExpressibleAsIntRect.
Covered by existing tests; no new behaviour.
BUG=147395
R=enne
Review URL: https://codereview.chromium.org/11275113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host_impl.cc')
-rw-r--r-- | cc/layer_tree_host_impl.cc | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index 4b1d2c6..a9f21d2 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -105,38 +105,34 @@ gfx::RectF PinchZoomViewport::bounds() const return bounds; } -FloatSize PinchZoomViewport::applyScroll(FloatSize& delta) +FloatSize PinchZoomViewport::applyScroll(const gfx::Vector2dF& delta) { - FloatSize overflow; - FloatRect pinchedBounds = cc::FloatRect(bounds()); + gfx::Vector2dF overflow; + gfx::RectF pinchedBounds = bounds(); - pinchedBounds.move(delta); + pinchedBounds.Offset(delta); if (pinchedBounds.x() < 0) { - overflow.setWidth(pinchedBounds.x()); - pinchedBounds.setX(0); + overflow.set_x(pinchedBounds.x()); + pinchedBounds.set_x(0); } if (pinchedBounds.y() < 0) { - overflow.setHeight(pinchedBounds.y()); - pinchedBounds.setY(0); + overflow.set_y(pinchedBounds.y()); + pinchedBounds.set_y(0); } - if (pinchedBounds.maxX() > m_layoutViewportSize.width()) { - overflow.setWidth( - pinchedBounds.maxX() - m_layoutViewportSize.width()); - pinchedBounds.move( - m_layoutViewportSize.width() - pinchedBounds.maxX(), 0); + if (pinchedBounds.right() > m_layoutViewportSize.width()) { + overflow.set_x(pinchedBounds.right() - m_layoutViewportSize.width()); + pinchedBounds.Offset(m_layoutViewportSize.width() - pinchedBounds.right(), 0); } - if (pinchedBounds.maxY() > m_layoutViewportSize.height()) { - overflow.setHeight( - pinchedBounds.maxY() - m_layoutViewportSize.height()); - pinchedBounds.move( - 0, m_layoutViewportSize.height() - pinchedBounds.maxY()); + if (pinchedBounds.bottom() > m_layoutViewportSize.height()) { + overflow.set_y(pinchedBounds.bottom() - m_layoutViewportSize.height()); + pinchedBounds.Offset(0, m_layoutViewportSize.height() - pinchedBounds.bottom()); } - m_pinchViewportScrollDelta = pinchedBounds.location(); + m_pinchViewportScrollDelta = cc::FloatPoint(pinchedBounds.origin()); - return overflow; + return cc::FloatSize(overflow); } WebTransformationMatrix PinchZoomViewport::implTransform() const @@ -691,7 +687,7 @@ void LayerTreeHostImpl::drawLayers(const FrameData& frame) // Once a RenderPass has been drawn, its damage should be cleared in // case the RenderPass will be reused next frame. for (unsigned int i = 0; i < frame.renderPasses.size(); i++) - frame.renderPasses[i]->setDamageRect(FloatRect()); + frame.renderPasses[i]->setDamageRect(gfx::RectF()); // The next frame should start by assuming nothing has changed, and changes are noted as they occur. for (unsigned int i = 0; i < frame.renderSurfaceLayerList->size(); i++) |