summaryrefslogtreecommitdiff
path: root/tests/CanvasCompare
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2016-03-09 16:42:40 -0800
committerStephen Hines <srhines@google.com>2016-03-09 16:42:40 -0800
commit74be0c9b4329bb79ed46f2532022995429ffdfe8 (patch)
tree51bbe5093f6f1496293a1bfc92797a9cf9d0ad0c /tests/CanvasCompare
parent6ca2cb499112871fd840597184dc75ba26fdeae8 (diff)
Fix some errors in errorCalculator.rs.
Bug: http://b/26987366 This code was accidentally casting a uchar4 to a single integer, which the latest llvm-rs-cc will flag as an error. The comparison was also incorrectly using a single integer comparison, instead of looking at all 4 uchar vector components. Change-Id: Id680d642cb0079461429f3910343c6dbe8d488ef
Diffstat (limited to 'tests/CanvasCompare')
-rw-r--r--tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs b/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs
index caa947d2b386..0a1742ef3867 100644
--- a/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs
+++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/errorCalculator.rs
@@ -14,10 +14,14 @@ void countInterestingRegions(const int32_t *v_in, int32_t *v_out) {
for (int x = 0; x < HEIGHT; x += REGION_SIZE) {
bool interestingRegion = false;
- int regionColor = (int) rsGetElementAt_uchar4(ideal, x, y);
+ uchar4 regionColor = rsGetElementAt_uchar4(ideal, x, y);
for (int i = 0; i < REGION_SIZE && !interestingRegion; i++) {
for (int j = 0; j < REGION_SIZE && !interestingRegion; j++) {
- interestingRegion |= ((int) rsGetElementAt_uchar4(ideal, x + j, y + i)) != regionColor;
+ uchar4 testVal = rsGetElementAt_uchar4(ideal, x + j, y + i);
+ interestingRegion |= (testVal.r != regionColor.r);
+ interestingRegion |= (testVal.g != regionColor.g);
+ interestingRegion |= (testVal.b != regionColor.b);
+ interestingRegion |= (testVal.a != regionColor.a);
}
}
if (interestingRegion) {