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/debug_rect_history.cc | |
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/debug_rect_history.cc')
-rw-r--r-- | cc/debug_rect_history.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cc/debug_rect_history.cc b/cc/debug_rect_history.cc index c085eef..455f354 100644 --- a/cc/debug_rect_history.cc +++ b/cc/debug_rect_history.cc @@ -55,9 +55,10 @@ void DebugRectHistory::savePaintRects(LayerImpl* layer) // regardless of whether this layer is skipped for actual drawing or not. Therefore // we traverse recursively over all layers, not just the render surface list. - if (!layer->updateRect().isEmpty() && layer->drawsContent()) { - FloatRect updateContentRect = layer->updateRect(); - updateContentRect.scale(layer->contentBounds().width() / static_cast<float>(layer->bounds().width()), layer->contentBounds().height() / static_cast<float>(layer->bounds().height())); + if (!layer->updateRect().IsEmpty() && layer->drawsContent()) { + float widthScale = layer->contentBounds().width() / static_cast<float>(layer->bounds().width()); + float heightScale = layer->contentBounds().height() / static_cast<float>(layer->bounds().height()); + gfx::RectF updateContentRect = gfx::ScaleRect(layer->updateRect(), widthScale, heightScale); m_debugRects.push_back(DebugRect(PaintRectType, MathUtil::mapClippedRect(layer->screenSpaceTransform(), updateContentRect))); } @@ -83,7 +84,7 @@ void DebugRectHistory::savePropertyChangedRects(const std::vector<LayerImpl*>& r continue; if (layer->layerPropertyChanged() || layer->layerSurfacePropertyChanged()) - m_debugRects.push_back(DebugRect(PropertyChangedRectType, MathUtil::mapClippedRect(layer->screenSpaceTransform(), FloatRect(FloatPoint::zero(), layer->contentBounds())))); + m_debugRects.push_back(DebugRect(PropertyChangedRectType, MathUtil::mapClippedRect(layer->screenSpaceTransform(), gfx::RectF(gfx::PointF(), layer->contentBounds())))); } } } @@ -116,7 +117,7 @@ void DebugRectHistory::saveScreenSpaceRects(const std::vector<LayerImpl* >& rend void DebugRectHistory::saveOccludingRects(const std::vector<gfx::Rect>& occludingRects) { for (size_t i = 0; i < occludingRects.size(); ++i) - m_debugRects.push_back(DebugRect(OccludingRectType, cc::IntRect(occludingRects[i]))); + m_debugRects.push_back(DebugRect(OccludingRectType, cc::FloatRect(occludingRects[i]))); } } // namespace cc |