summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceControl.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2015-05-22 09:51:44 -0700
committer Rob Carr <racarr@google.com> 2015-10-29 00:11:28 +0000
commit7dde599bf1a0dbef7390d91c2689d506371cdbd7 (patch)
tree6580e646734b6d4c64ab1a99dc2c710d4c8e0df1 /libs/gui/SurfaceControl.cpp
parent1fd88a560df8f58c3a798b25f64795e8306e527f (diff)
Support SurfaceView synchronization.
Add API for fetching the next frame number to be produced by a given buffer producer. Add an API to SurfaceComposer to defer execution of the current transaction until a given frame number. Together these may be used to synchronize app drawing and surface control updates. Change-Id: I8e0f4993332ac0199c768c88581a453fefbaff1d
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r--libs/gui/SurfaceControl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 1983027809..a945358cc0 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -145,6 +145,13 @@ status_t SurfaceControl::setCrop(const Rect& crop) {
return mClient->setCrop(mHandle, crop);
}
+status_t SurfaceControl::deferTransactionUntil(sp<IBinder> handle,
+ uint64_t frameNumber) {
+ status_t err = validate();
+ if (err < 0) return err;
+ return mClient->deferTransactionUntil(mHandle, handle, frameNumber);
+}
+
status_t SurfaceControl::clearLayerFrameStats() const {
status_t err = validate();
if (err < 0) return err;
@@ -190,5 +197,11 @@ sp<Surface> SurfaceControl::getSurface() const
return mSurfaceData;
}
+sp<IBinder> SurfaceControl::getHandle() const
+{
+ Mutex::Autolock lock(mLock);
+ return mHandle;
+}
+
// ----------------------------------------------------------------------------
}; // namespace android