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

Unified Diff: cc/priority_calculator.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/priority_calculator.h ('k') | cc/proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/priority_calculator.cc
diff --git a/cc/priority_calculator.cc b/cc/priority_calculator.cc
index fc250d958fae412a782017e8f49cb137660a2673..8993f88e3723ad2f6ae5bec334292dcb1246ba3c 100644
--- a/cc/priority_calculator.cc
+++ b/cc/priority_calculator.cc
@@ -5,6 +5,7 @@
#include "config.h"
#include "cc/priority_calculator.h"
+#include "ui/gfx/rect.h"
using namespace std;
@@ -71,9 +72,9 @@ int PriorityCalculator::lingeringPriority(int previousPriority)
}
namespace {
-int manhattanDistance(const IntRect& a, const IntRect& b)
+int manhattanDistance(const gfx::Rect& a, const gfx::Rect& b)
{
- IntRect c = unionRect(a, b);
+ gfx::Rect c = gfx::UnionRects(a, b);
int x = max(0, c.width() - a.width() - b.width() + 1);
int y = max(0, c.height() - a.height() - b.height() + 1);
return (x + y);
@@ -81,7 +82,7 @@ int manhattanDistance(const IntRect& a, const IntRect& b)
}
// static
-int PriorityCalculator::priorityFromDistance(const IntRect& visibleRect, const IntRect& textureRect, bool drawsToRootSurface)
+int PriorityCalculator::priorityFromDistance(const gfx::Rect& visibleRect, const gfx::Rect& textureRect, bool drawsToRootSurface)
{
int distance = manhattanDistance(visibleRect, textureRect);
if (!distance)
« no previous file with comments | « cc/priority_calculator.h ('k') | cc/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698