我有一个自定义视图组。在这个自定义视图组中有许多自定义视图。这些自定义视图在布局中互相重叠。
这些重叠的视图是有意为之,以创建“层次”。因此,一个层可能创建一些静态内容,但另一个层次的视图则创建不同的动画内容。问题出现在我从另一个线程调用.postInvalidate来刷新其中一个视图,该视图基本上是以60FPS运行的动画。在层叠视图之外,设备(Galaxy S3)可以达到60FPS。
在这个自定义视图组内部,.invalidate会导致2个硬件渲染视图中的1个失效,并且一些软件视图也会随之失效。
这些重叠的视图是有意为之,以创建“层次”。因此,一个层可能创建一些静态内容,但另一个层次的视图则创建不同的动画内容。问题出现在我从另一个线程调用.postInvalidate来刷新其中一个视图,该视图基本上是以60FPS运行的动画。在层叠视图之外,设备(Galaxy S3)可以达到60FPS。
在这个自定义视图组内部,.invalidate会导致2个硬件渲染视图中的1个失效,并且一些软件视图也会随之失效。
MyCustomViewThatShouldNotInvalidate(AbstractDialLayer).onDraw(Canvas) line: 68
MyCustomViewThatShouldNotInvalidate.onDraw(Canvas) line: 79
MyCustomViewThatShouldNotInvalidate(View).draw(Canvas) line: 13650
MyCustomViewThatShouldNotInvalidate(View).draw(Canvas, ViewGroup, long) line: 13534
MyCustomViewGroup(ViewGroup).drawChild(Canvas, View, long) line: 2938
MyCustomViewGroup(ViewGroup).dispatchDraw(Canvas) line: 2808
MyCustomViewGroup(View).buildDrawingCache(boolean) line: 12909
MyCustomViewGroup(View).getDisplayList(DisplayList, boolean) line: 12580
MyCustomViewGroup(View).getDisplayList() line: 12645
RelativeLayout(ViewGroup).dispatchGetDisplayList() line: 2920
RelativeLayout(View).getDisplayList(DisplayList, boolean) line: 12537
RelativeLayout(View).getDisplayList() line: 12645
RelativeLayout(ViewGroup).dispatchGetDisplayList() line: 2920
RelativeLayout(View).getDisplayList(DisplayList, boolean) line: 12537
RelativeLayout(View).getDisplayList() line: 12645
NoSaveStateFrameLayout(ViewGroup).dispatchGetDisplayList() line: 2920
NoSaveStateFrameLayout(View).getDisplayList(DisplayList, boolean) line: 12537
NoSaveStateFrameLayout(View).getDisplayList() line: 12645
ViewPager(ViewGroup).dispatchGetDisplayList() line: 2920
ViewPager(View).getDisplayList(DisplayList, boolean) line: 12537
ViewPager(View).getDisplayList() line: 12645
LinearLayout(ViewGroup).dispatchGetDisplayList() line: 2920
LinearLayout(View).getDisplayList(DisplayList, boolean) line: 12537
LinearLayout(View).getDisplayList() line: 12645
RelativeLayout(ViewGroup).dispatchGetDisplayList() line: 2920
RelativeLayout(View).getDisplayList(DisplayList, boolean) line: 12537
RelativeLayout(View).getDisplayList() line: 12645
NoSaveStateFrameLayout(ViewGroup).dispatchGetDisplayList() line: 2920
NoSaveStateFrameLayout(View).getDisplayList(DisplayList, boolean) line: 12537
NoSaveStateFrameLayout(View).getDisplayList() line: 12645
LinearLayout(ViewGroup).dispatchGetDisplayList() line: 2920
LinearLayout(View).getDisplayList(DisplayList, boolean) line: 12537
LinearLayout(View).getDisplayList() line: 12645
LongPressGestureDetectingFrameLayout(ViewGroup).dispatchGetDisplayList() line: 2920
LongPressGestureDetectingFrameLayout(View).getDisplayList(DisplayList, boolean) line: 12537
LongPressGestureDetectingFrameLayout(View).getDisplayList() line: 12645
FrameLayout(ViewGroup).dispatchGetDisplayList() line: 2920
FrameLayout(View).getDisplayList(DisplayList, boolean) line: 12537
FrameLayout(View).getDisplayList() line: 12645
LinearLayout(ViewGroup).dispatchGetDisplayList() line: 2920
LinearLayout(View).getDisplayList(DisplayList, boolean) line: 12537
LinearLayout(View).getDisplayList() line: 12645
CustomViewAbove(ViewGroup).dispatchGetDisplayList() line: 2920
CustomViewAbove(View).getDisplayList(DisplayList, boolean) line: 12537
CustomViewAbove(View).getDisplayList() line: 12645
SlidingMenu(ViewGroup).dispatchGetDisplayList() line: 2920
SlidingMenu(View).getDisplayList(DisplayList, boolean) line: 12537
SlidingMenu(View).getDisplayList() line: 12645
PhoneWindow$DecorView(ViewGroup).dispatchGetDisplayList() line: 2920
PhoneWindow$DecorView(View).getDisplayList(DisplayList, boolean) line: 12537
PhoneWindow$DecorView(View).getDisplayList() line: 12645
HardwareRenderer$Gl20Renderer(HardwareRenderer$GlRenderer).draw(View, View$AttachInfo, HardwareRenderer$HardwareDrawCallbacks, Rect) line: 1170
ViewRootImpl.draw(boolean) line: 2275
ViewRootImpl.performDraw() line: 2147
ViewRootImpl.performTraversals() line: 1958
ViewRootImpl.doTraversal() line: 1112
ViewRootImpl$TraversalRunnable.run() line: 4474
Choreographer$CallbackRecord.run(long) line: 725
Choreographer.doCallbacks(int, long) line: 555
Choreographer.doFrame(long, int) line: 525
Choreographer$FrameDisplayEventReceiver.run() line: 711
Handler.handleCallback(Message) line: 615
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 137
ActivityThread.main(String[]) line: 4918
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 511
ZygoteInit$MethodAndArgsCaller.run() line: 1004
ZygoteInit.main(String[]) line: 771
NativeStart.main(String[]) line: not available [native method]