From 19ae5f9ac9ce7a76003f68f9852a852d369a10b1 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 10 Oct 2019 13:11:23 -0700 Subject: [PATCH] [frameworks][base][hwui] fix -Wimplicit-int-float-conversion DIRTY_MAX cannot be represented precisely in an IEEE 754 single precision float. Calls to DamageAccumulator::dirty() that pass DIRTY_MAX thus result in an implicit cast that results in imprecision. Add one to the DIRTY_MAX constant so that its value can be precisely representing in a single precision float. Alternatively, we can accept the imprecision via explicit casts in multiple call sites. Bug: 139945549 Test: mm Change-Id: I38b2942f976ad05af2d0e45d1a9fe4214e759a02 Signed-off-by: Nick Desaulniers --- libs/hwui/DamageAccumulator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwui/DamageAccumulator.h b/libs/hwui/DamageAccumulator.h index 7d0b6877a71a8..030a20f31c42d 100644 --- a/libs/hwui/DamageAccumulator.h +++ b/libs/hwui/DamageAccumulator.h @@ -27,7 +27,7 @@ // Smaller than INT_MIN/INT_MAX because we offset these values // and thus don't want to be adding offsets to INT_MAX, that's bad #define DIRTY_MIN (-0x7ffffff - 1) -#define DIRTY_MAX (0x7ffffff) +#define DIRTY_MAX (0x8000000) namespace android { namespace uirenderer {