Update ANativeWindow clients for sync
This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.
Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index b585d68..5046bf5 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -97,22 +97,23 @@
ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(anw.get(), 3));
ANativeWindowBuffer* buf = 0;
- status_t err = anw->dequeueBuffer(anw.get(), &buf);
+ status_t err = native_window_dequeue_buffer_and_wait(anw.get(), &buf);
if (err) {
// we could fail if GRALLOC_USAGE_PROTECTED is not supported.
// that's okay as long as this is the reason for the failure.
// try again without the GRALLOC_USAGE_PROTECTED bit.
ASSERT_EQ(NO_ERROR, native_window_set_usage(anw.get(), 0));
- ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf));
+ ASSERT_EQ(NO_ERROR, native_window_dequeue_buffer_and_wait(anw.get(),
+ &buf));
return;
}
- ASSERT_EQ(NO_ERROR, anw->cancelBuffer(anw.get(), buf));
+ ASSERT_EQ(NO_ERROR, anw->cancelBuffer(anw.get(), buf, -1));
for (int i = 0; i < 4; i++) {
// Loop to make sure SurfaceFlinger has retired a protected buffer.
- ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf));
- ASSERT_EQ(NO_ERROR, anw->lockBuffer(anw.get(), buf));
- ASSERT_EQ(NO_ERROR, anw->queueBuffer(anw.get(), buf));
+ ASSERT_EQ(NO_ERROR, native_window_dequeue_buffer_and_wait(anw.get(),
+ &buf));
+ ASSERT_EQ(NO_ERROR, anw->queueBuffer(anw.get(), buf, -1));
}
heap = 0;
w = h = fmt = 0;