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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11275113: Remove most remaining references to IntRect and FloatRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compositor bindings Created 8 years, 1 month 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
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 9c605688ea532af73e355fb9050cd246898b3bad..7ef309a645cdbfeafe48b2d0de710b5a49ef5c60 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
@@ -702,7 +698,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++)
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698