summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-06-14 13:39:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-14 13:39:05 -0700
commit44ce622fc393ded35c68b7b871461521397431f0 (patch)
treeac9d7329c08136f77f359752d0323fd9e77441fc /libs
parent849d78973c25b73f65490ff64023e17317a2b29c (diff)
parentacce04ea933940a777fac097b61d55f8d61fd5d1 (diff)
downloadframeworks_base-44ce622fc393ded35c68b7b871461521397431f0.zip
frameworks_base-44ce622fc393ded35c68b7b871461521397431f0.tar.gz
frameworks_base-44ce622fc393ded35c68b7b871461521397431f0.tar.bz2
Merge "SurfaceTexture: add a format querying test."
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/tests/SurfaceTextureClient_test.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp
index e1a85f3..33fc21f 100644
--- a/libs/gui/tests/SurfaceTextureClient_test.cpp
+++ b/libs/gui/tests/SurfaceTextureClient_test.cpp
@@ -622,4 +622,29 @@ TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffersWi
EXPECT_EQ(1.f, mtx[15]);
}
+// This test verifies that the buffer format can be queried immediately after
+// it is set.
+TEST_F(SurfaceTextureClientTest, DISABLED_QueryFormatAfterSettingWorks) {
+ sp<ANativeWindow> anw(mSTC);
+ int fmts[] = {
+ // RGBA_8888 should not come first, as it's the default
+ HAL_PIXEL_FORMAT_RGBX_8888,
+ HAL_PIXEL_FORMAT_RGBA_8888,
+ HAL_PIXEL_FORMAT_RGB_888,
+ HAL_PIXEL_FORMAT_RGB_565,
+ HAL_PIXEL_FORMAT_BGRA_8888,
+ HAL_PIXEL_FORMAT_RGBA_5551,
+ HAL_PIXEL_FORMAT_RGBA_4444,
+ HAL_PIXEL_FORMAT_YV12,
+ };
+
+ const int numFmts = (sizeof(fmts) / sizeof(fmts[0]));
+ for (int i = 0; i < numFmts; i++) {
+ int fmt = -1;
+ ASSERT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, fmts[i]));
+ ASSERT_EQ(OK, anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &fmt));
+ EXPECT_EQ(fmts[i], fmt);
+ }
+}
+
} // namespace android