summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Arthur Hung <arthurhung@google.com> 2020-03-03 18:59:19 +0800
committer Arthur Hung <arthurhung@google.com> 2020-03-06 08:04:47 +0000
commitd9a25c40400a30f4f5a5df4204f3b3c4fb2c31f4 (patch)
treee5437f49e8f3e484aa6d52c3087936aebafb7db8
parent1d2d8b03657e6cc4bc13f7b4014cee4dad25f37f (diff)
Reduce setInputWindows calls
The compare function 'Region::isTriviallyEqual' is just compare the first iterator between two regions, and it will always get false if we passed it from binder that would create a new one even they are equal. That would cause the layer to recompute the visible regions and make it direct to call 'updateInputWindowInfo' continually. - Change to use Region::hasSameRects to reduce some unnecessary calls. Bug: 133780957 Test: manual, open debug logs and watch a video Change-Id: Ibc9c488c179b403b203a1853cd6f3be9bb23fbaa
-rw-r--r--services/surfaceflinger/LayerRejecter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/LayerRejecter.cpp b/services/surfaceflinger/LayerRejecter.cpp
index d3364a0929..e6c8654cbf 100644
--- a/services/surfaceflinger/LayerRejecter.cpp
+++ b/services/surfaceflinger/LayerRejecter.cpp
@@ -120,7 +120,7 @@ bool LayerRejecter::reject(const sp<GraphicBuffer>& buf, const BufferItem& item)
// We latch the transparent region here, instead of above where we latch
// the rest of the geometry because it is only content but not necessarily
// resize dependent.
- if (!mFront.activeTransparentRegion_legacy.isTriviallyEqual(
+ if (!mFront.activeTransparentRegion_legacy.hasSameRects(
mFront.requestedTransparentRegion_legacy)) {
mFront.activeTransparentRegion_legacy = mFront.requestedTransparentRegion_legacy;