[Tizen] Added wait/client wait methods to sync abstraction 33/306233/1
authorDavid Steele <david.steele@samsung.com>
Mon, 12 Feb 2024 18:42:56 +0000 (18:42 +0000)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 19 Feb 2024 05:20:05 +0000 (14:20 +0900)
Note, sync abstraction isn't used by dali-core, but still
has a test implementation, so not going to move it to
dali-adaptor in this patchset.

Change-Id: Iea2b9cb74bcbaffbdf1a181de796010aa371ad03
Signed-off-by: David Steele <david.steele@samsung.com>
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-impl.cpp
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-impl.h
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-object.h
dali/integration-api/graphics-sync-abstraction.h

index 17f53a7ba596ce5e894fe86a813e4ff5de016dd9..bb4a500b979b261d60795802fed9457657661c61 100644 (file)
@@ -38,6 +38,16 @@ bool TestSyncObject::IsSynced()
   return synced;
 }
 
+void TestSyncObject::Wait()
+{
+  mTrace.PushCall("SyncObject::Wait", ""); // Trace the method
+}
+
+void TestSyncObject::ClientWait()
+{
+  mTrace.PushCall("SyncObject::ClientWait", ""); // Trace the method
+}
+
 TestGraphicsSyncImplementation::TestGraphicsSyncImplementation()
 {
   Initialize();
index cbc53314cea3f1e2a7bef87a1e4510aa114a476e..21fd3588b808c14caa27ae056d0ba5474e61d057 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_SYNC_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,7 +40,10 @@ class TestSyncObject : public Integration::GraphicsSyncAbstraction::SyncObject
 public:
   TestSyncObject(TraceCallStack& trace);
   ~TestSyncObject() override;
-  bool            IsSynced() override;
+  bool IsSynced() override;
+  void Wait() override;
+  void ClientWait() override;
+
   bool            synced;
   TraceCallStack& mTrace;
 };
index c33de6c06cdae0a1865e404d9e474e4ed83dfaea..688668723ed87f1efb5219cd840584760f3ef895 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_GRAPHICS_SYNC_OBJECT_H_
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,7 @@
 
 #include <dali/graphics-api/graphics-sync-object-create-info.h>
 #include <dali/graphics-api/graphics-sync-object.h>
-
-#include <test-graphics-sync-impl.h>
+#include "test-graphics-sync-impl.h"
 
 namespace Dali
 {
index 38bee543adef20a118197fa0dc8a2b4dccb3a725..44b24fb46a4465494eb9786ba520d0a1c7d7fede 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_GRAPHICS_SYNC_ABSTRACTION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +55,17 @@ public:
      * can now be destroyed)
      */
     virtual bool IsSynced() = 0;
+
+    /**
+     * Wait in the GPU for the synchronisation object to be signalled (but can timeout)
+     */
+    virtual void Wait() = 0;
+
+    /**
+     * Wait in the CPU for the synchronisation object to be signalled.
+     * This will block the render thread - use with caution.
+     */
+    virtual void ClientWait() = 0;
   };
 
   /**