summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceControl.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2022-02-10 16:31:02 -0500
committerJohn Reck <jreck@google.com>2022-02-10 16:32:04 -0500
commita96a6df15625cad23e5331be99189e19243e4904 (patch)
tree2c1fc7706b28ff9801bc99183d18388b3cd7cb3b /core/java/android/view/SurfaceControl.java
parentb42de79509444544b5077d8653b1bfb1fd44b932 (diff)
Add more docs per API council feedback
Test: make Fixes: 218314633 Change-Id: I49fa3defa7907f48e650618295f7db758e247a2a
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
-rw-r--r--core/java/android/view/SurfaceControl.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 7f115fad5735..aebe7dc5acb8 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -3692,21 +3692,32 @@ public final class SurfaceControl implements Parcelable {
/**
* Sets the buffer transform that should be applied to the current buffer.
*
+ * This can be used in combination with
+ * {@link AttachedSurfaceControl#addOnBufferTransformHintChangedListener(AttachedSurfaceControl.OnBufferTransformHintChangedListener)}
+ * to pre-rotate the buffer for the current display orientation. This can
+ * improve the performance of displaying the associated buffer.
+ *
* @param sc The SurfaceControl to update
* @param transform The transform to apply to the buffer.
* @return this
*/
public @NonNull Transaction setBufferTransform(@NonNull SurfaceControl sc,
- /* TODO: Mark the intdef */ int transform) {
+ @SurfaceControl.BufferTransform int transform) {
checkPreconditions(sc);
nativeSetBufferTransform(mNativeObject, sc.mNativeObject, transform);
return this;
}
/**
- * Updates the region for the content on this surface updated in this transaction.
+ * Updates the region for the content on this surface updated in this transaction. The
+ * damage region is the area of the buffer that has changed since the previously
+ * sent buffer. This can be used to reduce the amount of recomposition that needs
+ * to happen when only a small region of the buffer is being updated, such as for
+ * a small blinking cursor or a loading indicator.
*
- * If unspecified, the complete surface is assumed to be damaged.
+ * @param sc The SurfaceControl on which to set the damage region
+ * @param region The region to set. If null, the entire buffer is assumed dirty. This is
+ * equivalent to not setting a damage region at all.
*/
public @NonNull Transaction setDamageRegion(@NonNull SurfaceControl sc,
@Nullable Region region) {