i have custom view (a waveform) needs synchronized media player progress. problem i'm having different behavior when using invalidate(rect) here code makes update in custom view:
public void setprogress(int currentduration) { // ... code calculate dirty width invalidate(mdirtywidth,0,mdirtywidth+ mdirtywidthregion, viewheight); }
this working on samsung galaxy 4 (android 4.4.2). screenshot "show gpu view updates" enabled
but in nexus 7 (android 5.1), whole view gets invalidated each time:
after android 5.0, canvas clipbounds view bounds hardwareaccelerated, invalidate(dirty rect)'s dirty rect ignored
5.0 viewrootimpl.java http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/android/view/viewrootimpl.java/
dirty.setempty(); mblockresizebuffer = false; mattachinfo.mhardwarerenderer.draw(mview, mattachinfo, this);
4.4 viewrootimpl.java http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/android/view/viewrootimpl.java/?v=source
mcurrentdirty.set(dirty); dirty.setempty(); attachinfo.mhardwarerenderer.draw(mview, attachinfo, this, animating ? null : mcurrentdirty);