rtInfo.SetSurface(&mSurfaceWidth); // Can point to anything, really.
mScene.SetSurfaceRenderTarget(rtInfo);
+
+ mScenes.push_back(mScene);
}
void TestApplication::InitializeCore()
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
if(!uploadOnly)
{
- mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+ for(auto&& scene : mScenes)
+ {
+ mCore->RenderScene(mRenderStatus, scene, true /*render the off-screen buffers*/);
+ mCore->RenderScene(mRenderStatus, scene, false /*render the surface*/);
+ }
}
mCore->PostRender();
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
+bool TestApplication::RenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location)
+{
+ DoUpdate(intervalMilliseconds, location);
+
+ // Reset the status
+ mRenderStatus.SetNeedsUpdate(false);
+ mRenderStatus.SetNeedsPostRender(false);
+
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+
+ for(auto&& scene : mScenes)
+ {
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect{};
+
+ mCore->PreRender(scene, damagedRects);
+ mCore->RenderScene(mRenderStatus, scene, true /*render the off-screen buffers*/);
+ for(auto&& iter : damagedRects)
+ {
+ clippingRect.Merge(iter);
+ }
+ mCore->RenderScene(mRenderStatus, scene, false /*render the surface*/, clippingRect);
+ }
+ mCore->PostRender();
+
+ mFrame++;
+
+ return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
+}
+
uint32_t TestApplication::GetUpdateStatus()
{
return mStatus.KeepUpdating();
return time;
}
+void TestApplication::AddScene(Integration::Scene scene)
+{
+ mScenes.push_back(scene);
+}
+
+void TestApplication::RemoveScene(Integration::Scene scene)
+{
+ mScenes.erase(std::remove(mScenes.begin(), mScenes.end(), scene), mScenes.end());
+}
+
} // namespace Dali
bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL, bool uploadOnly = false);
bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
+ bool RenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
uint32_t GetUpdateStatus();
bool UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
bool RenderOnly();
return mScene;
}
+ void AddScene(Integration::Scene scene);
+ void RemoveScene(Integration::Scene scene);
+
private:
void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL, bool uploadOnly = false);
Integration::UpdateStatus mStatus;
Integration::RenderStatus mRenderStatus;
- Integration::Core* mCore;
- Dali::Integration::Scene mScene;
+ Integration::Core* mCore;
+ Dali::Integration::Scene mScene;
+ std::vector<Integration::Scene> mScenes;
uint32_t mSurfaceWidth;
uint32_t mSurfaceHeight;
return mScene.GetRenderTaskList();
}
+void Window::KeepRendering(float durationSeconds)
+{
+ mScene.KeepRendering(durationSeconds);
+}
+
std::string Window::GetNativeResourceId() const
{
return mWindowBase->GetNativeWindowResourceId();
Dali::Layer GetLayer(uint32_t depth) const;
/**
- * @copydoc Dali::DevelWindow::GetRenderTaskList()
+ * @copydoc Dali::Window::GetRenderTaskList()
*/
Dali::RenderTaskList GetRenderTaskList() const;
/**
+ * @copydoc Dali::Window::KeepRendering()
+ */
+ void KeepRendering(float durationSeconds);
+
+ /**
* @brief Get window resource ID assigned by window manager
* @return The resource ID of the window
*/
std::vector<int> mAvailableAngles;
int mPreferredAngle;
- int mRotationAngle; ///< The angle of the rotation
- int mWindowWidth; ///< The width of the window
- int mWindowHeight; ///< The height of the window
- int mNativeWindowId; ///< The Native Window Id
+ int mRotationAngle; ///< The angle of the rotation
+ int mWindowWidth; ///< The width of the window
+ int mWindowHeight; ///< The height of the window
+ int mNativeWindowId; ///< The Native Window Id
EventHandlerPtr mEventHandler; ///< The window events handler
OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
/*
- * Copyright (c) 2022 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.
return GetImplementation(*this).GetRenderTaskList();
}
+void Window::KeepRendering(float durationSeconds)
+{
+ GetImplementation(*this).KeepRendering(durationSeconds);
+}
+
Window::KeyEventSignalType& Window::KeyEventSignal()
{
return GetImplementation(*this).KeyEventSignal();
#define DALI_WINDOW_H
/*
- * Copyright (c) 2022 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.
*/
RenderTaskList GetRenderTaskList();
+ /**
+ * @brief Keep rendering for at least the given amount of time.
+ *
+ * By default, Dali will stop rendering when no Actor positions are being set, and when no animations are running etc.
+ * This method is useful to force screen refreshes.
+ *
+ * @SINCE_2_2.29
+ * @param[in] durationSeconds Time to keep rendering, 0 means render at least one more frame
+ */
+ void KeepRendering(float durationSeconds);
+
public: // Signals
/**
* @brief The user should connect to this signal to get a timing when window gains focus or loses focus.