diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/i965_test_fixture.cpp | 20 | ||||
-rw-r--r-- | test/i965_test_fixture.h | 10 |
2 files changed, 23 insertions, 7 deletions
diff --git a/test/i965_test_fixture.cpp b/test/i965_test_fixture.cpp index d7f30c2..dd81430 100644 --- a/test/i965_test_fixture.cpp +++ b/test/i965_test_fixture.cpp @@ -97,12 +97,24 @@ I965TestFixture::operator VADisplay() return m_vaDisplay; } -Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count) +Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count, + const SurfaceAttribs& attributes) { Surfaces surfaces(count, VA_INVALID_ID); - EXPECT_STATUS( - i965_CreateSurfaces( - *this, w, h, format, surfaces.size(), surfaces.data())); + if (attributes.empty()) { + EXPECT_STATUS( + i965_CreateSurfaces( + *this, w, h, format, surfaces.size(), surfaces.data())); + } else { + VADriverContextP ctx(*this); + EXPECT_PTR(ctx); + if (ctx) + EXPECT_STATUS( + ctx->vtable->vaCreateSurfaces2( + *this, format, w, h, surfaces.data(), surfaces.size(), + const_cast<VASurfaceAttrib*>(attributes.data()), + attributes.size())); + } for (size_t i(0); i < count; ++i) { EXPECT_ID(surfaces[i]); diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h index 511c791..5915852 100644 --- a/test/i965_test_fixture.h +++ b/test/i965_test_fixture.h @@ -32,6 +32,7 @@ #include <vector> typedef std::vector<VASurfaceID> Surfaces; +typedef std::vector<VASurfaceAttrib> SurfaceAttribs; typedef std::vector<VAConfigAttrib> ConfigAttribs; /** @@ -99,10 +100,13 @@ public: void terminate(); /** - * Convenience wrapper for i965_CreateSurfaces. May generate a non-fatal - * test assertion failure. + * Convenience wrapper for i965_CreateSurfaces or i965_CreateSurfaces2. + * If SurfaceAttribs are specified then i965_CreateSurfaces2 is used, + * otherwise i965_CreateSurfaces is used. May generate a non-fatal test + * assertion failure. */ - Surfaces createSurfaces(int w, int h, int format, size_t count = 1); + Surfaces createSurfaces(int w, int h, int format, size_t count = 1, + const SurfaceAttribs& = SurfaceAttribs()); /** * Convenience wrapper for i965_DestroySurfaces. May generate a non-fatal |