diff options
author | John Reck <jreck@google.com> | 2023-11-02 14:01:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-11-02 14:01:18 +0000 |
commit | fc16412fb861c3b2f670d3156d16924293080bea (patch) | |
tree | 3ea23f6cbb01680551ed9e901f28b901585a9cac /graphics | |
parent | 9cbaf67401724d8fbe1276ebcb9b08e9cd7845d8 (diff) | |
parent | 1b152e712159c0b82831a7567ce2f3c49cdc11bf (diff) | |
download | base-fc16412fb861c3b2f670d3156d16924293080bea.tar.gz |
Merge "Implement automatic SV clipping" into main
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/RenderNode.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/RenderNode.java b/graphics/java/android/graphics/RenderNode.java index 15d26ebe66f6..27325694073c 100644 --- a/graphics/java/android/graphics/RenderNode.java +++ b/graphics/java/android/graphics/RenderNode.java @@ -272,6 +272,17 @@ public final class RenderNode { void positionChanged(long frameNumber, int left, int top, int right, int bottom); /** + * Called by native by a Rendering Worker thread to update window position; includes + * the local rect that represents the clipped area of the RenderNode's bounds. + * + * @hide + */ + default void positionChanged(long frameNumber, int left, int top, int right, int bottom, + int clipLeft, int clipTop, int clipRight, int clipBottom) { + positionChanged(frameNumber, left, top, right, bottom); + } + + /** * Called by JNI * * @hide */ @@ -287,6 +298,23 @@ public final class RenderNode { } /** + * Called by JNI + * + * @hide */ + static boolean callPositionChanged2(WeakReference<PositionUpdateListener> weakListener, + long frameNumber, int left, int top, int right, int bottom, + int clipLeft, int clipTop, int clipRight, int clipBottom) { + final PositionUpdateListener listener = weakListener.get(); + if (listener != null) { + listener.positionChanged(frameNumber, left, top, right, bottom, clipLeft, + clipTop, clipRight, clipBottom); + return true; + } else { + return false; + } + } + + /** * Call to apply a stretch effect to any child SurfaceControl layers * * TODO: Fold this into positionChanged & have HWUI do the ASurfaceControl calls? @@ -371,6 +399,15 @@ public final class RenderNode { } @Override + public void positionChanged(long frameNumber, int left, int top, int right, int bottom, + int clipLeft, int clipTop, int clipRight, int clipBottom) { + for (PositionUpdateListener pul : mListeners) { + pul.positionChanged(frameNumber, left, top, right, bottom, clipLeft, clipTop, + clipRight, clipBottom); + } + } + + @Override public void positionLost(long frameNumber) { for (PositionUpdateListener pul : mListeners) { pul.positionLost(frameNumber); |