Skip to content

Commit c9f345f

Browse files
committed
Document interaction of SurfaceView and post-layout transforms
Bug: 7179570 Change-Id: I9c4d71242bcb832c0cb3b62ec26aba54f146d70a
1 parent 3b772c6 commit c9f345f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

core/java/android/view/SurfaceView.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@
4646
*
4747
* <p>The surface is Z ordered so that it is behind the window holding its
4848
* SurfaceView; the SurfaceView punches a hole in its window to allow its
49-
* surface to be displayed. The view hierarchy will take care of correctly
49+
* surface to be displayed. The view hierarchy will take care of correctly
5050
* compositing with the Surface any siblings of the SurfaceView that would
51-
* normally appear on top of it. This can be used to place overlays such as
51+
* normally appear on top of it. This can be used to place overlays such as
5252
* buttons on top of the Surface, though note however that it can have an
5353
* impact on performance since a full alpha-blended composite will be performed
5454
* each time the Surface changes.
5555
*
56+
* <p> The transparent region that makes the surface visible is based on the
57+
* layout positions in the view hierarchy. If the post-layout transform
58+
* properties are used to draw a sibling view on top of the SurfaceView, the
59+
* view may not be properly composited with the surface.
60+
*
5661
* <p>Access to the underlying surface is provided via the SurfaceHolder interface,
5762
* which can be retrieved by calling {@link #getHolder}.
5863
*
@@ -62,14 +67,14 @@
6267
* Surface is created and destroyed as the window is shown and hidden.
6368
*
6469
* <p>One of the purposes of this class is to provide a surface in which a
65-
* secondary thread can render into the screen. If you are going to use it
70+
* secondary thread can render into the screen. If you are going to use it
6671
* this way, you need to be aware of some threading semantics:
6772
*
6873
* <ul>
6974
* <li> All SurfaceView and
7075
* {@link SurfaceHolder.Callback SurfaceHolder.Callback} methods will be called
7176
* from the thread running the SurfaceView's window (typically the main thread
72-
* of the application). They thus need to correctly synchronize with any
77+
* of the application). They thus need to correctly synchronize with any
7378
* state that is also touched by the drawing thread.
7479
* <li> You must ensure that the drawing thread only touches the underlying
7580
* Surface while it is valid -- between

0 commit comments

Comments
 (0)