#define DALI_TEST_APPLICATION_H
/*
- * Copyright (c) 2020 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.
#include <dali/integration-api/resource-policies.h>
#include <dali/integration-api/scene.h>
#include <dali/integration-api/trace.h>
+
#include <dali/public-api/common/dali-common.h>
#include <test-platform-abstraction.h>
-#include "test-gl-abstraction.h"
-#include "test-gl-context-helper-abstraction.h"
-#include "test-gl-sync-abstraction.h"
+#include "test-graphics-controller.h"
#include "test-render-controller.h"
namespace Dali
static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
+ static const Rect<int> DEFAULT_SURFACE_RECT;
+
static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
static constexpr uint32_t DEFAULT_VERTICAL_DPI = 217;
void CreateScene();
void InitializeCore();
~TestApplication() override;
- static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
- static void LogContext(bool start, const char* tag);
- Dali::Integration::Core& GetCore();
- TestPlatformAbstraction& GetPlatform();
- TestRenderController& GetRenderController();
+ static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
+ static void LogContext(bool start, const char* tag, const char* message);
+ Dali::Integration::Core& GetCore();
+ TestPlatformAbstraction& GetPlatform();
+ TestRenderController& GetRenderController();
+ TestGraphicsController& GetGraphicsController();
+
TestGlAbstraction& GetGlAbstraction();
- TestGlSyncAbstraction& GetGlSyncAbstraction();
- TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
- void ProcessEvent(const Integration::Event& event);
- void SendNotification();
- bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
- bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
- bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
- uint32_t GetUpdateStatus();
- bool UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
- bool RenderOnly();
- void ResetContext();
- bool GetRenderNeedsUpdate();
- bool GetRenderNeedsPostRender();
- uint32_t Wait(uint32_t durationToWait);
- static void EnableLogging(bool enabled)
+ TestGraphicsSyncImplementation& GetGraphicsSyncImpl();
+
+ void ProcessEvent(const Integration::Event& event);
+ void SendNotification();
+ 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();
+ void ResetContext();
+ bool GetRenderNeedsUpdate();
+ bool GetRenderNeedsPostRender();
+ uint32_t Wait(uint32_t durationToWait);
+ static void EnableLogging(bool enabled)
{
mLoggingEnabled = enabled;
}
return mScene;
}
+ void AddScene(Integration::Scene scene);
+ void RemoveScene(Integration::Scene scene);
+
private:
- void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
+ void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL, bool uploadOnly = false);
protected:
- TestPlatformAbstraction mPlatformAbstraction;
- TestRenderController mRenderController;
- TestGlAbstraction mGlAbstraction;
- TestGlSyncAbstraction mGlSyncAbstraction;
- TestGlContextHelperAbstraction mGlContextHelperAbstraction;
+ TestPlatformAbstraction mPlatformAbstraction;
+ TestRenderController mRenderController;
+ TestGraphicsController mGraphicsController;
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;
uint32_t mFrame;
+ Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget;
+
struct
{
uint32_t x;