Add SetFrameRenderedCallback() in OffscreenWindow
[platform/core/uifw/dali-adaptor.git] / dali / internal / offscreen / common / offscreen-window-impl.cpp
index d85bdd3..c55fadb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -115,6 +115,19 @@ void OffscreenWindow::SetPostRenderCallback(CallbackBase* callback)
   surface->SetRenderNotification(mRenderNotification.get());
 }
 
+void OffscreenWindow::SetFrameRenderedCallback(CallbackBase* callback)
+{
+  NativeRenderSurface* surface = GetNativeRenderSurface();
+
+  if(!surface)
+  {
+    DALI_LOG_ERROR("NativeRenderSurface is null.");
+    return;
+  }
+
+  surface->SetFrameRenderedCallback(callback);
+}
+
 NativeRenderSurface* OffscreenWindow::GetNativeRenderSurface() const
 {
   return dynamic_cast<NativeRenderSurface*>(mSurface.get());