254b417129de2a8c5612826a152f8a26c8f1d0e8 |
|
27-Jul-2015 |
Dake Gu <dake@google.com> |
Remove overlay view for better performance Overlay view does not help performance, when animating background color, invalidate() will be called on overlay View. That's equivalent to invalidate() on ShadowOverlayContainer. Remove the extra view to save memory and override draw() instead. This turns out to save about 5~10% in UI thread and RenderThread in a vertical scrolling of BrowseFragment according to systrace. Refactoring a ShadowOverlayHelper to include all options for ListRowPresenter: hasOverlay, hasShadow, hasRoundedCorner, make decision whether to create a wrapper. Ultimately the extra layer ShadowOverlayContainer could be removed and we can use setForeground() on any view for API>=23, but animating foreground causes uncessary rebuildOutline() right now. So we force to always use a wrapper for overlay. b/22794753 Change-Id: I4848f7fc6b832706445da8e6e1b807d0f1830968
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/ForegroundHelper.java
|