Namratha
Namratha

Reputation: 16780

Relationship between Surface and Canvas: Android

What exactly is the relationship between a Surface and Canvas.

Please explain.

Upvotes: 2

Views: 3410

Answers (1)

Sephy
Sephy

Reputation: 50392

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.

Upvotes: 5

Related Questions