Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e937898 authored by Sumir Kataria's avatar Sumir Kataria Committed by Automerger Merge Worker
Browse files

Merge "Add documentation clarifying the differences between...

Merge "Add documentation clarifying the differences between Surface/TextureView" into tm-dev am: ef65e8b8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17476331



Change-Id: I4757cc59dfdfb4e0bc1f004693e8e04ef64e534b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 79a8d809 ef65e8b8
Loading
Loading
Loading
Loading
+39 −2
Original line number Diff line number Diff line
@@ -41,6 +41,43 @@ import android.util.Log;
 * <p>TextureView can only be used in a hardware accelerated window. When
 * rendered in software, TextureView will draw nothing.</p>
 *
 * <p><b>TextureView vs. SurfaceView Capabilities</b></p>

 * <p>
 *   <table>
 *     <tr>
 *       <th>&nbsp;</th>
 *       <th style="text-align: center;">TextureView</th>
 *       <th style="text-align: center;">SurfaceView</th>
 *     </tr>
 *     <tr>
 *       <td>Supports alpha</td>
 *       <td style="text-align: center;">X</td>
 *       <td style="text-align: center;">&nbsp;</td>
 *     </tr>
 *     <tr>
 *       <td>Supports rotations</td>
 *       <td style="text-align: center;">X</td>
 *       <td style="text-align: center;">&nbsp;</td>
 *     </tr>
 *     <tr>
 *       <td>Supports clipping</td>
 *       <td style="text-align: center;">X</td>
 *       <td style="text-align: center;">&nbsp;</td>
 *     </tr>
 *     <tr>
 *       <td>HDR support</td>
 *       <td style="text-align: center;">Limited (on Android T+)</td>
 *       <td style="text-align: center;">Full</td>
 *     </tr>
 *     <tr>
 *       <td>Renders DRM content</td>
 *       <td style="text-align: center;">&nbsp;</td>
 *       <td style="text-align: center;">X</td>
 *     </tr>
 *   </table>
 * </p>
 *
 * <p>Unlike {@link SurfaceView}, TextureView does not create a separate
 * window but behaves as a regular View. This key difference allows a
 * TextureView to have translucency, arbitrary rotations, and complex
@@ -51,8 +88,8 @@ import android.util.Log;
 * hierarchy is that it may have slower performance than
 * SurfaceView. TextureView contents must be copied, internally, from the
 * underlying surface into the view displaying those contents. For
 * that reason, SurfaceView is recommended as a more general solution
 * to problems requiring rendering to surfaces.</p>
 * that reason, <b>SurfaceView is recommended as a more general solution
 * to problems requiring rendering to surfaces.</b></p>
 *
 * <p>Using a TextureView is simple: all you need to do is get its
 * {@link SurfaceTexture}. The {@link SurfaceTexture} can then be used to