diff options
| author | 2020-11-05 11:56:00 +0800 | |
|---|---|---|
| committer | 2020-11-06 10:39:24 +0800 | |
| commit | 6fa58b7ac41fef952085727969a8857bd34709e2 (patch) | |
| tree | db989be8e43c8db20679be777d59de065d4660b7 | |
| parent | 35ccd3d6b2f50b70bf6fb66a0004b20f2f5b067c (diff) | |
Fix BLASTBufferQueueTest stuck on verifing captured pixel
To prevent the captured screenshot could be different to the
native rgb values and cause the verify function stuck when accessing
the buffer.
Test: atest libgui_test
Fix: 172521710
Change-Id: I2fb47eaf4c735d3960c092dad874426f1b126fd2
| -rw-r--r-- | libs/gui/tests/BLASTBufferQueue_test.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/gui/tests/BLASTBufferQueue_test.cpp b/libs/gui/tests/BLASTBufferQueue_test.cpp index 9299721be3..f3559fa6c1 100644 --- a/libs/gui/tests/BLASTBufferQueue_test.cpp +++ b/libs/gui/tests/BLASTBufferQueue_test.cpp @@ -123,6 +123,7 @@ protected: .apply(); mCaptureArgs.displayToken = mDisplayToken; + mCaptureArgs.dataspace = ui::Dataspace::V0_SRGB; } void setUpProducer(BLASTBufferQueueHelper adapter, sp<IGraphicBufferProducer>& producer) { @@ -181,6 +182,7 @@ protected: for (uint32_t row = 0; row < height; row++) { for (uint32_t col = 0; col < width; col++) { uint8_t* pixel = (uint8_t*)(bufData + (row * stride) + col); + ASSERT_NE(nullptr, pixel); bool inRegion; if (!outsideRegion) { inRegion = row >= region.top + border && row < region.bottom - border && |