summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2017-04-03 19:00:26 -0700
committerRobert Carr <racarr@google.com>2017-04-03 19:11:40 -0700
commit5429daaa510ae144ca9a9a7052980faf8d9b2087 (patch)
tree16cf994130280044954a431255a415c4bcbf9463 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent57132a15137f9d43a276cbadc93dbdd76ef12e06 (diff)
Request layout when updating child layout params.
In order to clear the measure cache, we need to requestLayout when updating the child layout params. To see why, consider the case of a Frame or Linear layout which will measure different heights depending on the (top/left/right/bottom)Margin parameters of it's childrens layout params. Now imagine the following sequence of events: 1. We request a layout on the FrameLayout 2. We measure the FrameLayout and place a value in the cache. 3. Now we update the margin parameters on one of the frame layouts children. Because the parent already has a layout requested we don't call parent.requestLayout (see View.java#requestLayout), and thus the parent measure cache isn't cleared. 4. Now we measure the frame layout again and we incorrectly used the cached value. Calling to requestLayout when the child layout params change clears the cache properly. If the child didn't call request layout from it's own relayout, it must mean that a layout was already pending (step 1 in the sequence), and so no more work should be triggered besides clearing the cache. Bug: 33095565 Bug: 33308065 Bug: 34388764 Test: Manual case in bugs. Change-Id: I9148f32530588e4dc859297f9658f506b38e72f0
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions