diff options
author | Marissa Wall <marissaw@google.com> | 2019-03-22 14:03:19 -0700 |
---|---|---|
committer | Marissa Wall <marissaw@google.com> | 2019-03-27 09:32:42 -0700 |
commit | 3dad52d38519ef4ad6d13095a8fa756bb736ae85 (patch) | |
tree | 6f95afff00b98cfd8d2ab0f9fbc708dca3525429 /libs/gui/include | |
parent | 78b7220f542826771223f9b5c0b876874dd398d2 (diff) | |
download | android_frameworks_native-3dad52d38519ef4ad6d13095a8fa756bb736ae85.tar.gz android_frameworks_native-3dad52d38519ef4ad6d13095a8fa756bb736ae85.tar.bz2 android_frameworks_native-3dad52d38519ef4ad6d13095a8fa756bb736ae85.zip |
blast: transaction callbacks should come in order
Previously, if no SurfaceControls where marked to get callbacks,
a callback was sent directly from SurfaceComposerClient so we could
save a binder call into SurfaceFlinger and a binder call for the
callback.
Although this saved us 2 binder calls, it made the transactions
callbacks come out of order. The public api guarantees that all
callbacks must come in order.
This patch moves the callback from SurfaceComposerClient into
SurfaceFlinger so the callbacks are in order.
Bug: 128519264
Test: SurfaceFlinger_test
Change-Id: Ia1cadb81adb69b58a4d6d43ae453c96a1572f833
Diffstat (limited to 'libs/gui/include')
-rw-r--r-- | libs/gui/include/gui/ISurfaceComposer.h | 15 | ||||
-rw-r--r-- | libs/gui/include/gui/LayerState.h | 6 |
2 files changed, 12 insertions, 9 deletions
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h index 0ef5b3964..fe85fdf69 100644 --- a/libs/gui/include/gui/ISurfaceComposer.h +++ b/libs/gui/include/gui/ISurfaceComposer.h @@ -20,13 +20,10 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/RefBase.h> -#include <utils/Errors.h> -#include <utils/Timers.h> -#include <utils/Vector.h> - #include <binder/IInterface.h> +#include <gui/ITransactionCompletedListener.h> + #include <ui/ConfigStoreTypes.h> #include <ui/DisplayedFrameStats.h> #include <ui/FrameStats.h> @@ -34,6 +31,11 @@ #include <ui/GraphicTypes.h> #include <ui/PixelFormat.h> +#include <utils/Errors.h> +#include <utils/RefBase.h> +#include <utils/Timers.h> +#include <utils/Vector.h> + #include <optional> #include <vector> @@ -133,7 +135,8 @@ public: const sp<IBinder>& applyToken, const InputWindowCommands& inputWindowCommands, int64_t desiredPresentTime, - const cached_buffer_t& uncacheBuffer) = 0; + const cached_buffer_t& uncacheBuffer, + const std::vector<ListenerCallbacks>& listenerCallbacks) = 0; /* signal that we're done booting. * Requires ACCESS_SURFACE_FLINGER permission diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h index 77bf8f1dc..225649775 100644 --- a/libs/gui/include/gui/LayerState.h +++ b/libs/gui/include/gui/LayerState.h @@ -23,7 +23,6 @@ #include <utils/Errors.h> #include <gui/IGraphicBufferProducer.h> -#include <gui/ITransactionCompletedListener.h> #include <math/mat4.h> #ifndef NO_INPUT @@ -86,7 +85,7 @@ struct layer_state_t { eApiChanged = 0x04000000, eSidebandStreamChanged = 0x08000000, eColorTransformChanged = 0x10000000, - eListenerCallbacksChanged = 0x20000000, + eHasListenerCallbacksChanged = 0x20000000, eInputInfoChanged = 0x40000000, eCornerRadiusChanged = 0x80000000, eFrameChanged = 0x1'00000000, @@ -120,6 +119,7 @@ struct layer_state_t { surfaceDamageRegion(), api(-1), colorTransform(mat4()), + hasListenerCallbacks(false), bgColorAlpha(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false) { @@ -182,7 +182,7 @@ struct layer_state_t { sp<NativeHandle> sidebandStream; mat4 colorTransform; - std::vector<ListenerCallbacks> listenerCallbacks; + bool hasListenerCallbacks; #ifndef NO_INPUT InputWindowInfo inputInfo; #endif |