Relationship between Surface and Canvas: Android

为君一笑 提交于 2019-12-04 14:32:56

问题


What exactly is the relationship between a Surface and Canvas.

Please explain.


回答1:


A surface is a buffer. A Canvas holds the drawing.

Views are not attached to the Canvas nor the Surface. The window is tied to a Surface and the ViewRoot asks the Surface for a Canvas that is then used by the Views to draw onto.

For a detailled anwser, you can read this whole discussion, really interesting.



来源:https://stackoverflow.com/questions/3370212/relationship-between-surface-and-canvas-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!