SF: Change rounding behavior in setGeometry
- Add an option for a transform to round outwards instead of to the
nearest pixel.
- Use this new rounding behavior when converting the crop rectangle
from display-space to layer-space. Otherwise a pixel that will
partially be on the screen might be marked as transparent.
Bug 30510632
Change-Id: I1aece177cc29c54ee0d4a2c919e47442eb455f30
diff --git a/services/surfaceflinger/Transform.h b/services/surfaceflinger/Transform.h
index 90855da..66463a0 100644
--- a/services/surfaceflinger/Transform.h
+++ b/services/surfaceflinger/Transform.h
@@ -78,7 +78,8 @@
Rect makeBounds(int w, int h) const;
vec2 transform(int x, int y) const;
Region transform(const Region& reg) const;
- Rect transform(const Rect& bounds) const;
+ Rect transform(const Rect& bounds,
+ bool roundOutwards = false) const;
Transform operator * (const Transform& rhs) const;
// assumes the last row is < 0 , 0 , 1 >
vec2 transform(const vec2& v) const;