summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/tests/TransactionTestHarnesses.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/tests/TransactionTestHarnesses.h')
-rw-r--r--services/surfaceflinger/tests/TransactionTestHarnesses.h42
1 files changed, 8 insertions, 34 deletions
diff --git a/services/surfaceflinger/tests/TransactionTestHarnesses.h b/services/surfaceflinger/tests/TransactionTestHarnesses.h
index 89f608645d..f0af363469 100644
--- a/services/surfaceflinger/tests/TransactionTestHarnesses.h
+++ b/services/surfaceflinger/tests/TransactionTestHarnesses.h
@@ -40,9 +40,9 @@ public:
ui::DisplayState displayState;
SurfaceComposerClient::getDisplayState(displayToken, &displayState);
- ui::DisplayMode displayMode;
- SurfaceComposerClient::getActiveDisplayMode(displayToken, &displayMode);
- const ui::Size& resolution = displayMode.resolution;
+ DisplayConfig displayConfig;
+ SurfaceComposerClient::getActiveDisplayConfig(displayToken, &displayConfig);
+ const ui::Size& resolution = displayConfig.resolution;
sp<IBinder> vDisplay;
sp<IGraphicBufferProducer> producer;
@@ -57,8 +57,6 @@ public:
// Sample usage bits from screenrecord
GRALLOC_USAGE_HW_VIDEO_ENCODER |
GRALLOC_USAGE_SW_READ_OFTEN);
- sp<BufferListener> listener = new BufferListener(this);
- itemConsumer->setFrameAvailableListener(listener);
vDisplay = SurfaceComposerClient::createDisplay(String8("VirtualDisplay"),
false /*secure*/);
@@ -67,16 +65,9 @@ public:
t.setDisplaySurface(vDisplay, producer);
t.setDisplayLayerStack(vDisplay, 0);
t.setDisplayProjection(vDisplay, displayState.orientation,
- Rect(displayState.layerStackSpaceRect), Rect(resolution));
+ Rect(displayState.viewport), Rect(resolution));
t.apply();
SurfaceComposerClient::Transaction().apply(true);
-
- std::unique_lock lock(mMutex);
- mAvailable = false;
- // Wait for frame buffer ready.
- mCondition.wait_for(lock, std::chrono::seconds(2),
- [this]() NO_THREAD_SAFETY_ANALYSIS { return mAvailable; });
-
BufferItem item;
itemConsumer->acquireBuffer(&item, 0, true);
auto sc = std::make_unique<ScreenCapture>(item.mGraphicBuffer);
@@ -89,23 +80,6 @@ public:
protected:
LayerTransactionTest* mDelegate;
RenderPath mRenderPath;
- std::mutex mMutex;
- std::condition_variable mCondition;
- bool mAvailable = false;
-
- void onFrameAvailable() {
- std::unique_lock lock(mMutex);
- mAvailable = true;
- mCondition.notify_all();
- }
-
- class BufferListener : public ConsumerBase::FrameAvailableListener {
- public:
- BufferListener(LayerRenderPathTestHarness* owner) : mOwner(owner) {}
- LayerRenderPathTestHarness* mOwner;
-
- void onFrameAvailable(const BufferItem& /*item*/) { mOwner->onFrameAvailable(); }
- };
};
class LayerTypeTransactionHarness : public LayerTransactionTest {
@@ -124,14 +98,14 @@ public:
outTransformHint, format);
}
- void fillLayerColor(const sp<SurfaceControl>& layer, const Color& color, uint32_t bufferWidth,
- uint32_t bufferHeight) {
+ void fillLayerColor(const sp<SurfaceControl>& layer, const Color& color, int32_t bufferWidth,
+ int32_t bufferHeight) {
ASSERT_NO_FATAL_FAILURE(LayerTransactionTest::fillLayerColor(mLayerType, layer, color,
bufferWidth, bufferHeight));
}
- void fillLayerQuadrant(const sp<SurfaceControl>& layer, uint32_t bufferWidth,
- uint32_t bufferHeight, const Color& topLeft, const Color& topRight,
+ void fillLayerQuadrant(const sp<SurfaceControl>& layer, int32_t bufferWidth,
+ int32_t bufferHeight, const Color& topLeft, const Color& topRight,
const Color& bottomLeft, const Color& bottomRight) {
ASSERT_NO_FATAL_FAILURE(LayerTransactionTest::fillLayerQuadrant(mLayerType, layer,
bufferWidth, bufferHeight,