Factor viewport scaling into coverage calculation
Change-Id: I32114ead0ca42eaf2161d516a4281da216b61fa4
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
index a3ae9be..065e86f 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/PlaybackGraphs.java
@@ -37,10 +37,10 @@
private static Paint whiteLabels;
private static double viewportCoverage(TileData view, TileData tile) {
- if (tile.left < view.right
- && tile.right >= view.left
- && tile.top < view.bottom
- && tile.bottom >= view.top) {
+ if (tile.left < (view.right * view.scale)
+ && tile.right >= (view.left * view.scale)
+ && tile.top < (view.bottom * view.scale)
+ && tile.bottom >= (view.top * view.scale)) {
return 1.0f;
}
return 0.0f;
@@ -215,7 +215,7 @@
int lastBar = 0;
for (int frameIndex = 0; frameIndex < data.frames.length; frameIndex++) {
TileData frame[] = data.frames[frameIndex];
- int newBar = (frame[0].top + frame[0].bottom) / 2;
+ int newBar = (int)((frame[0].top + frame[0].bottom) * frame[0].scale / 2.0f);
MetricGen s = Metrics[metricIndex];
double absoluteValue = s.getValue(frame);
diff --git a/tests/TileBenchmark/src/com/test/tilebenchmark/RunData.java b/tests/TileBenchmark/src/com/test/tilebenchmark/RunData.java
index 2da61cc..5e48afd 100644
--- a/tests/TileBenchmark/src/com/test/tilebenchmark/RunData.java
+++ b/tests/TileBenchmark/src/com/test/tilebenchmark/RunData.java
@@ -46,7 +46,8 @@
public String toString() {
return "Tile (" + left + "," + top + ")->("
- + right + "," + bottom + ")";
+ + right + "," + bottom + ")"
+ + (isReady ? "ready" : "NOTready") + " at scale " + scale;
}
}