Lines Matching defs:reporter
47 virtual bool init(skiatest::Reporter* reporter) = 0;
52 virtual sk_sp<SkImage> importHardwareBufferForRead(skiatest::Reporter* reporter,
54 virtual sk_sp<SkSurface> importHardwareBufferForWrite(skiatest::Reporter* reporter,
58 virtual bool flushSurfaceAndSignalSemaphore(skiatest::Reporter* reporter, sk_sp<SkSurface>) = 0;
59 virtual bool importAndWaitOnSemaphore(skiatest::Reporter* reporter, int fdHandle,
100 bool init(skiatest::Reporter* reporter) override;
102 sk_sp<SkImage> importHardwareBufferForRead(skiatest::Reporter* reporter,
104 sk_sp<SkSurface> importHardwareBufferForWrite(skiatest::Reporter* reporter,
108 bool flushSurfaceAndSignalSemaphore(skiatest::Reporter* reporter, sk_sp<SkSurface>) override;
109 bool importAndWaitOnSemaphore(skiatest::Reporter* reporter, int fdHandle,
117 bool importHardwareBuffer(skiatest::Reporter* reporter, AHardwareBuffer* buffer);
143 bool EGLTestHelper::init(skiatest::Reporter* reporter) {
168 ERRORF(reporter, "Failed to get the eglGetNativeClientBufferAndroid proc");
174 ERRORF(reporter, "Failed to get the proc eglCreateImageKHR");
181 ERRORF(reporter, "Failed to get the proc EGLImageTargetTexture2DOES");
187 ERRORF(reporter, "Failed to get the proc eglCreateSyncKHR");
193 ERRORF(reporter, "Failed to get the proc eglWaitSyncKHR");
199 ERRORF(reporter, "Failed to get the proc eglGetSyncAttribKHR");
206 ERRORF(reporter, "Failed to get the proc eglDupNativeFenceFDANDROID");
212 ERRORF(reporter, "Failed to get the proc eglDestroySyncKHR");
220 bool EGLTestHelper::importHardwareBuffer(skiatest::Reporter* reporter, AHardwareBuffer* buffer) {
237 ERRORF(reporter, "Failed to create GL Texture");
242 ERRORF(reporter, "Failed to bind GL Texture");
248 ERRORF(reporter, "EGLImageTargetTexture2DOES failed (%#x)", (int) error);
256 sk_sp<SkImage> EGLTestHelper::importHardwareBufferForRead(skiatest::Reporter* reporter,
258 if (!this->importHardwareBuffer(reporter, buffer)) {
267 REPORTER_ASSERT(reporter, backendTex.isValid());
277 ERRORF(reporter, "Failed to make wrapped GL SkImage");
284 sk_sp<SkSurface> EGLTestHelper::importHardwareBufferForWrite(skiatest::Reporter* reporter,
286 if (!this->importHardwareBuffer(reporter, buffer)) {
295 REPORTER_ASSERT(reporter, backendTex.isValid());
305 ERRORF(reporter, "Failed to make wrapped GL SkSurface");
312 bool EGLTestHelper::flushSurfaceAndSignalSemaphore(skiatest::Reporter* reporter,
317 ERRORF(reporter, "Failed to create EGLSync for EGL_SYNC_NATIVE_FENCE_ANDROID\n");
327 ERRORF(reporter, "Failed to delete EGLSync, error: %d\n", result);
334 bool EGLTestHelper::importAndWaitOnSemaphore(skiatest::Reporter* reporter, int fdHandle,
343 ERRORF(reporter,
349 ERRORF(reporter, "Failed called to eglWaitSyncKHR, error: %d\n", result);
354 ERRORF(reporter, "Failed to delete EGLSync, error: %d\n", result);
373 ERRORF(reporter, "Function ptr for vk%s could not be acquired\n", #name); \
382 ERRORF(reporter, "Function ptr for vk%s could not be acquired\n", #name); \
436 bool init(skiatest::Reporter* reporter) override;
446 bool flushSurfaceAndSignalSemaphore(skiatest::Reporter* reporter, sk_sp<SkSurface>) override;
447 bool importAndWaitOnSemaphore(skiatest::Reporter* reporter, int fdHandle,
450 sk_sp<SkImage> importHardwareBufferForRead(skiatest::Reporter* reporter,
453 sk_sp<SkSurface> importHardwareBufferForWrite(skiatest::Reporter* reporter,
461 bool checkOptimalHardwareBuffer(skiatest::Reporter* reporter);
463 bool importHardwareBuffer(skiatest::Reporter* reporter, AHardwareBuffer* buffer, bool forWrite,
466 bool setupSemaphoreForSignaling(skiatest::Reporter* reporter, GrBackendSemaphore*);
467 bool exportSemaphore(skiatest::Reporter* reporter, const GrBackendSemaphore&);
509 bool VulkanTestHelper::init(skiatest::Reporter* reporter) {
581 REPORTER_ASSERT(reporter, fDirectContext.get());
586 return this->checkOptimalHardwareBuffer(reporter);
589 bool VulkanTestHelper::checkOptimalHardwareBuffer(skiatest::Reporter* reporter) {
628 ERRORF(reporter, "vkGetPhysicalDeviceImageFormatProperites failed, err: %d", err);
633 REPORTER_ASSERT(reporter, DEV_W <= imageFormatProperties.maxExtent.width);
634 REPORTER_ASSERT(reporter, DEV_H <= imageFormatProperties.maxExtent.height);
638 REPORTER_ASSERT(reporter, SkToBool(VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT &
640 REPORTER_ASSERT(reporter, SkToBool(VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT &
643 REPORTER_ASSERT(reporter, SkToBool(AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE &
649 bool VulkanTestHelper::importHardwareBuffer(skiatest::Reporter* reporter,
665 ERRORF(reporter, "GetAndroidHardwareBufferPropertiesAndroid failed, err: %d", err);
669 REPORTER_ASSERT(reporter, VK_FORMAT_R8G8B8A8_UNORM == hwbFormatProps.format);
670 REPORTER_ASSERT(reporter,
675 REPORTER_ASSERT(reporter,
720 ERRORF(reporter, "Create Image failed, err: %d", err);
746 ERRORF(reporter, "Failed to find valid heap for imported memory");
770 ERRORF(reporter, "AllocateMemory failed for imported buffer, err: %d", err);
783 ERRORF(reporter, "BindImageMemory failed for imported buffer, err: %d", err);
804 sk_sp<SkImage> VulkanTestHelper::importHardwareBufferForRead(skiatest::Reporter* reporter,
807 if (!this->importHardwareBuffer(reporter, buffer, false, &imageInfo)) {
821 ERRORF(reporter, "Failed to create wrapped Vulkan SkImage");
828 bool VulkanTestHelper::flushSurfaceAndSignalSemaphore(skiatest::Reporter* reporter,
833 if (!this->setupSemaphoreForSignaling(reporter, &semaphore)) {
842 ERRORF(reporter, "Failing call to flush on GrDirectContext");
846 if (!this->exportSemaphore(reporter, semaphore)) {
852 bool VulkanTestHelper::setupSemaphoreForSignaling(skiatest::Reporter* reporter,
869 ERRORF(reporter, "HANDLE_TYPE_SYNC_FD not listed as exportFromImportedHandleTypes");
874 ERRORF(reporter, "HANDLE_TYPE_SYNC_FD not listed as compatibleHandleTypes");
881 ERRORF(reporter, "HANDLE_TYPE_SYNC_FD doesn't support export and import feature");
898 ERRORF(reporter, "Failed to create signal semaphore, err: %d", err);
905 bool VulkanTestHelper::exportSemaphore(skiatest::Reporter* reporter,
909 ERRORF(reporter, "Invalid vulkan handle in export call");
921 ERRORF(reporter, "Failed to export signal semaphore, err: %d", err);
928 bool VulkanTestHelper::importAndWaitOnSemaphore(skiatest::Reporter* reporter, int fdHandle,
938 ERRORF(reporter, "Failed to create import semaphore, err: %d", err);
952 ERRORF(reporter, "Failed to import semaphore, err: %d", err);
959 ERRORF(reporter, "Failed to add wait semaphore to surface");
966 sk_sp<SkSurface> VulkanTestHelper::importHardwareBufferForWrite(skiatest::Reporter* reporter,
969 if (!this->importHardwareBuffer(reporter, buffer, true, &imageInfo)) {
983 ERRORF(reporter, "Failed to create wrapped Vulkan SkSurface");
1036 static bool check_read(skiatest::Reporter* reporter, const SkBitmap& srcBitmap,
1044 ERRORF(reporter, "Expected readback pixel (%d, %d) value 0x%08x, got 0x%08x.",
1048 ERRORF(reporter, "Got good readback pixel (%d, %d) value 0x%08x, got 0x%08x.",
1081 void run_test(skiatest::Reporter* reporter, const GrContextOptions& options,
1100 if (!srcHelper->init(reporter)) {
1117 if (!dstHelper->init(reporter)) {
1158 ERRORF(reporter, "Failed to allocated hardware buffer, error: %d", error);
1170 ERRORF(reporter, "Failed to lock hardware buffer");
1189 ERRORF(reporter, "CPU HWB Expected readpix (%d, %d) value 0x%08x, got 0x%08x.",
1199 sk_sp<SkSurface> surface = srcHelper->importHardwareBufferForWrite(reporter, buffer);
1214 ERRORF(reporter, "Read Pixels on surface failed");
1219 REPORTER_ASSERT(reporter, check_read(reporter, srcBitmap, dstBitmapSurface));
1227 if (!srcHelper->flushSurfaceAndSignalSemaphore(reporter, std::move(surface))) {
1243 sk_sp<SkImage> wrappedImage = dstHelper->importHardwareBufferForRead(reporter, buffer);
1261 ERRORF(reporter, "Failed to create destination SkSurface");
1268 if (!dstHelper->importAndWaitOnSemaphore(reporter, srcHelper->getFdHandle(), dstSurf)) {
1278 ERRORF(reporter, "Read Pixels failed");
1286 REPORTER_ASSERT(reporter, check_read(reporter, srcBitmap, dstBitmapFinal));
1294 DEF_GPUTEST(VulkanHardwareBuffer_CPU_Vulkan, reporter, options) {
1295 run_test(reporter, options, SrcType::kCPU, DstType::kVulkan, false);
1298 DEF_GPUTEST(VulkanHardwareBuffer_Vulkan_Vulkan, reporter, options) {
1299 run_test(reporter, options, SrcType::kVulkan, DstType::kVulkan, false);
1302 DEF_GPUTEST(VulkanHardwareBuffer_Vulkan_Vulkan_Syncs, reporter, options) {
1303 run_test(reporter, options, SrcType::kVulkan, DstType::kVulkan, true);
1307 DEF_GPUTEST(VulkanHardwareBuffer_EGL_Vulkan, reporter, options) {
1308 run_test(reporter, options, SrcType::kEGL, DstType::kVulkan, false);
1311 DEF_GPUTEST(VulkanHardwareBuffer_CPU_EGL, reporter, options) {
1312 run_test(reporter, options, SrcType::kCPU, DstType::kEGL, false);
1315 DEF_GPUTEST(VulkanHardwareBuffer_EGL_EGL, reporter, options) {
1316 run_test(reporter, options, SrcType::kEGL, DstType::kEGL, false);
1319 DEF_GPUTEST(VulkanHardwareBuffer_Vulkan_EGL, reporter, options) {
1320 run_test(reporter, options, SrcType::kVulkan, DstType::kEGL, false);
1323 DEF_GPUTEST(VulkanHardwareBuffer_EGL_EGL_Syncs, reporter, options) {
1324 run_test(reporter, options, SrcType::kEGL, DstType::kEGL, true);
1327 DEF_GPUTEST(VulkanHardwareBuffer_Vulkan_EGL_Syncs, reporter, options) {
1328 run_test(reporter, options, SrcType::kVulkan, DstType::kEGL, true);
1331 DEF_GPUTEST(VulkanHardwareBuffer_EGL_Vulkan_Syncs, reporter, options) {
1332 run_test(reporter, options, SrcType::kEGL, DstType::kVulkan, true);