diff options
author | Steven Laver <lavers@google.com> | 2019-05-08 06:18:42 -0700 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-05-08 06:18:42 -0700 |
commit | 4a30c150e58ec67edb92a7bec5ea48cebd6b90d4 (patch) | |
tree | 6d902794d7e59acd54f54ef235feb75becfb01e3 /native/android/surface_control.cpp | |
parent | a6c7c402af360214e509d15980957e74fc673f42 (diff) | |
parent | e4f4eabc31685c001c2b46d8fa87b443f4af5b21 (diff) |
Merge QP1A.190501.001
Change-Id: I0f9f887d6a33702a6988709d8296731cfdb8f73d
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index d07052bb3b3f..7ee2f0a1db18 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -411,7 +411,15 @@ void ASurfaceTransaction_setDamageRegion(ASurfaceTransaction* aSurfaceTransactio Region region; for (uint32_t i = 0; i < count; ++i) { - region.merge(static_cast<const Rect&>(rects[i])); + region.orSelf(static_cast<const Rect&>(rects[i])); + } + + // Hardware composer interprets a DamageRegion with a single Rect of {0,0,0,0} to be an + // undamaged region and {0,0,-1,-1} to be a fully damaged buffer. This is a confusing + // distinction for a public api. Instead, default both cases to be a fully damaged buffer. + if (count == 1 && region.getBounds().isEmpty()) { + transaction->setSurfaceDamageRegion(surfaceControl, Region::INVALID_REGION); + return; } transaction->setSurfaceDamageRegion(surfaceControl, region); |