Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plenty of frames are over 16ms. Fix it. #3

Merged
merged 1 commit into from
Jan 27, 2016
Merged

Conversation

songzhw
Copy link
Contributor

@songzhw songzhw commented Jan 27, 2016

Hi, 通过Profile GPU Rendering看, 部分帧的绘制都超过了16ms。
追踪代码,发现onMeasure()被调用了多次,而其实我们代码里要实现的是子View的layout的变化,不需要再次重新Measure.
以此为思路, 找到根源在于requestLayout()方法。 这个方法会让父View重新measure & layout自己。 所以改动一下, 只layout自己的各个子项即可。

效果图稍后附上~

@songzhw
Copy link
Contributor Author

songzhw commented Jan 27, 2016

修改前:
3d_ball_gpu_overweight

修改后:
3d_ball_gpu_improve_01

misakuo added a commit that referenced this pull request Jan 27, 2016
Plenty of frames are over 16ms. Fix it.
@misakuo misakuo merged commit 00575df into misakuo:master Jan 27, 2016
@misakuo
Copy link
Owner

misakuo commented Jan 27, 2016

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants