summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorRiddle Hsu <riddlehsu@google.com>2020-10-30 15:07:28 +0800
committerRiddle Hsu <riddlehsu@google.com>2020-11-02 16:41:14 +0800
commit3213c9657b88e9d2d0d6f529e1a63bb30ff42cdc (patch)
tree9521f16f51edc69772bce69e0f5671cf0f7703c2 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentf2d1d264793831f07b689e534366fb55f12174cc (diff)
Reduce unnecessary invocation of setInputWindowInfo
Usually most fields of InputWindowHandle don't change frequently. Therefore, only the changed instances need to be updated. That reduces the overhead of JNI invocation (especially NativeInputWindowHandle::updateInfo which may be called from setInputWindowInfo). There should be no behavior change. - Add a InputWindowHandle.ChangeDetectionWrapper to wrap the original handle. So the changes of its fields can be tracked. - Make InputApplicationHandle java side immutable. Its content should be rarely changed. Then it is easier to compare by instance. This might also reduces the race condition of accessing its field from InputDispatcher because the instance is different. - Move some fields that won't change of InputWindowHandle to the constructor of WindowState to reduce unnecessary updates. - When a window cannot receive input, reuse the per-window input window handle to populate the disabled info, so there won't be a shared instance that its fields always need to be updated. - Reduce unnecessary Region#translate if the offsets are zero. - For a simple activity launch, the invocation amount of setInputWindowInfo is reduced 90% (from 126 to 11). - The metrics updateInputWindows_mean of WmPerfTests is reduced 50%+ (from 0.89ms to 0.38ms on an old mid-end device). Bug: 168008622 Test: WindowStateTests#testUpdateInputWindowHandle WindowInputTests InternalWindowOperationPerfTest Change-Id: Ief84bbe6e6fa4da5309912059904932ccf775b75
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions