Improve SurfaceView bounds calculation
Estimate SurfaceView bounds conservatively to handle GPU rounding errors. When SurfaceView border is in the middle of a pixel, a fudge factor is added or substracted to always extend the region. Test: passed CTS tests Bug: 131240729 Change-Id: I74d5c1b40f9e730758f26341eb4a028bbae6ecd9
This commit is contained in:
@@ -546,7 +546,7 @@ static void android_view_RenderNode_requestPositionUpdates(JNIEnv* env, jobject,
|
||||
if (CC_LIKELY(transform.isPureTranslate())) {
|
||||
// snap/round the computed bounds, so they match the rounding behavior
|
||||
// of the clear done in SurfaceView#draw().
|
||||
bounds.snapToPixelBoundaries();
|
||||
bounds.snapGeometryToPixelBoundaries(false);
|
||||
} else {
|
||||
// Conservatively round out so the punched hole (in the ZOrderOnTop = true case)
|
||||
// doesn't extend beyond the other window
|
||||
|
||||
Reference in New Issue
Block a user