summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/GLRenderer.java5
-rw-r--r--core/java/android/view/HardwareRenderer.java5
-rw-r--r--core/java/android/view/ThreadedRenderer.java7
-rw-r--r--core/java/android/view/ViewRootImpl.java3
4 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/view/GLRenderer.java b/core/java/android/view/GLRenderer.java
index d6e1781..ad33b6f 100644
--- a/core/java/android/view/GLRenderer.java
+++ b/core/java/android/view/GLRenderer.java
@@ -1226,6 +1226,11 @@ public class GLRenderer extends HardwareRenderer {
}
private static native void nSetDisplayListData(long displayList, long newData);
+ @Override
+ void fence() {
+ // Everything is immediate, so this is a no-op
+ }
+
private RenderNode buildDisplayList(View view, HardwareCanvas canvas) {
if (mDrawDelta <= 0) {
return view.mRenderNode;
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 4f646e1..ae265aa 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -576,6 +576,11 @@ public abstract class HardwareRenderer {
abstract void setDisplayListData(long displayList, long newData);
/**
+ * Blocks until all previously queued work has completed.
+ */
+ abstract void fence();
+
+ /**
* Describes a series of frames that should be drawn on screen as a graph.
* Each frame is composed of 1 or more elements.
*/
diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java
index 7b8a1ff..3d143d7 100644
--- a/core/java/android/view/ThreadedRenderer.java
+++ b/core/java/android/view/ThreadedRenderer.java
@@ -245,6 +245,11 @@ public class ThreadedRenderer extends HardwareRenderer {
}
@Override
+ void fence() {
+ nFence(mNativeProxy);
+ }
+
+ @Override
protected void finalize() throws Throwable {
try {
nDeleteProxy(mNativeProxy);
@@ -277,4 +282,6 @@ public class ThreadedRenderer extends HardwareRenderer {
private static native long nCreateTextureLayer(long nativeProxy);
private static native boolean nCopyLayerInto(long nativeProxy, long layer, long bitmap);
private static native void nDestroyLayer(long nativeProxy, long layer);
+
+ private static native void nFence(long nativeProxy);
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index a35c28e..94f0683 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -2259,6 +2259,9 @@ public final class ViewRootImpl implements ViewParent,
if (mReportNextDraw) {
mReportNextDraw = false;
+ if (mAttachInfo.mHardwareRenderer != null) {
+ mAttachInfo.mHardwareRenderer.fence();
+ }
if (LOCAL_LOGV) {
Log.v(TAG, "FINISHED DRAWING: " + mWindowAttributes.getTitle());