[SurfaceFlinger] Allow DispSync to be GMock'd
Move the DispSync implementation into an 'impl' namespace to match the
other GMock related changes I've done. The DispSync in the previous
namespace is now the abstract interface.
SurfaceFlinger is adjusted slightly to create an instance of the
impl::DispSync, but store it in a std::unique_ptr<DispSync> for the
abstract class, with small adjustments to the code to deference the now
pointer.
The existing display transaction unit test is updated to define the
GMock, inject one, and to set the call expectations for a few tests are
added to match how it was called.
Test: atest libsurfaceflinger_unittest
Bug: None
Change-Id: I91b38c5194dbf86a6f0b658f3ab9f227b54d5354
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index 0913de4..9c35825 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -245,8 +245,9 @@
LayerRejecter r(mDrawingState, getCurrentState(), recomputeVisibleRegions,
getProducerStickyTransform() != 0, mName.string(), mOverrideScalingMode,
getTransformToDisplayInverse(), mFreezeGeometryUpdates);
- status_t updateResult = mConsumer->updateTexImage(&r, mFlinger->mPrimaryDispSync, &mAutoRefresh,
- &queuedBuffer, mLastFrameNumberReceived);
+ status_t updateResult =
+ mConsumer->updateTexImage(&r, *mFlinger->mPrimaryDispSync, &mAutoRefresh, &queuedBuffer,
+ mLastFrameNumberReceived);
if (updateResult == BufferQueue::PRESENT_LATER) {
// Producer doesn't want buffer to be displayed yet. Signal a
// layer update so we check again at the next opportunity.