summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2017-06-06 12:14:04 -0700
committerJohn Reck <jreck@google.com>2017-06-06 12:14:04 -0700
commitfbff7117abac7a335c6bc2e2f8b927a8dac5753e (patch)
treec16bb5d083083a9deaf5d7713956e64114cc86ec /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent5fc8f7d08a5e1835b792757dc25f3ab2420d4b75 (diff)
Clear native shader when Paint shader changes
Since Recents never goes away that means TaskViewThumbnail never goes away which in turn means mDrawPaint never goes away. mDrawPaint has a setShader(null) called on it to release the BitmapShader it was previously drawn with, but that change didn't push down to native until the next time the paint was used. As a result, the Paint held on to a reference to the bitmap. The fix is simple, when the shader is changed simply push down an immediate clear of the native shader. Since the bitmap of a BitmapShader isn't changeable we don't need to worry about clearing references for shader mutation, merely when Paint#setShader() happens. Bug: 38258699 Test: Open & close recents, observe EGL memory immediately returns to sub-5MB. Change-Id: I6742efa8ae8dfca76b62a06bc1a1a00646feba64
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions