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

Unified Diff: cc/debug_rect_history.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector 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/debug_rect_history.h ('k') | cc/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug_rect_history.cc
diff --git a/cc/debug_rect_history.cc b/cc/debug_rect_history.cc
index c085eef8db9756168b815efba32bd7e7cd1afd59..455f354b6debc1ce3fa17f6e185586831003bfaf 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
« no previous file with comments | « cc/debug_rect_history.h ('k') | cc/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698