summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorchaviw <chaviw@google.com>2020-10-01 11:55:47 -0700
committerchaviw <chaviw@google.com>2020-10-14 17:17:43 -0700
commit7b5c08e5e69484534ed20a8236da3642e8f14d8c (patch)
treeb59b9a0efc66dda4e7d06ca76c33979f10f590a1 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentae00abf8ed1f483d7d444ca335fd86ca362e46bf (diff)
Ensure thread safety with render thread and UI Thread.
There were a few places that were not thread safe. 1. finishBLASTSync is called from the Render Thread. It was updating mSurfaceChangedTransaction, which send to WMS on the UI Thread. Instead, create a new local Transaction object to allow the Render Thread to merge the mRtBLASTSyncTransaction into it. Then on the UI thread, merge the temporary transaction into mSurfaceChangedTransaction 2. finishBLASTSync was getting called if the draw was unable to run asynchronously. This would mean it would get executed on the UI Thread, possibly causing a race. Instead, remove since there should be nothing on the blast sync transaction, mRtNextFrameReportedConsumeWithBlast would never have been set, and mSendNextFrameToWm is set to false beforehand. Test: YT with and without Blast Change-Id: I72e70fea258a933f51aaaf78c7056a0d3fbac8b3
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions