Change-Id: Icf349509f0c61595b2b8a756e560825b7ea82bf7
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Create render target for the scene
Graphics::RenderTargetCreateInfo rtInfo{};
rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
// Create render target for the scene
Graphics::RenderTargetCreateInfo rtInfo{};
rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
- mRenderTarget = mGraphicsController.CreateRenderTarget(rtInfo, nullptr);
- mScene.SetSurfaceRenderTarget(mRenderTarget.get());
+ rtInfo.SetSurface(&mSurfaceWidth); // Can point to anything, really.
+
+ mScene.SetSurfaceRenderTarget(rtInfo);
}
void TestApplication::InitializeCore()
}
void TestApplication::InitializeCore()
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
void TestGraphicsController::PresentRenderTarget(Graphics::RenderTarget* renderTarget)
{
*/
void TestGraphicsController::PresentRenderTarget(Graphics::RenderTarget* renderTarget)
{
+ auto* rt = static_cast<const TestGraphicsRenderTarget*>(renderTarget);
TraceCallStack::NamedParams namedParams;
namedParams["renderTarget"] << std::hex << renderTarget;
TraceCallStack::NamedParams namedParams;
namedParams["renderTarget"] << std::hex << renderTarget;
- mCallStack.PushCall("PresentRenderTarget", "", namedParams);
+ namedParams["surface"] << std::hex << rt->mCreateInfo.surface;
+ mCallStack.PushCall("PresentRenderTarget", namedParams.str(), namedParams);
Graphics::UniquePtr<Graphics::RenderTarget> TestGraphicsController::CreateRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo, Graphics::UniquePtr<Graphics::RenderTarget>&& oldRenderTarget)
{
Graphics::UniquePtr<Graphics::RenderTarget> TestGraphicsController::CreateRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo, Graphics::UniquePtr<Graphics::RenderTarget>&& oldRenderTarget)
{
- mCallStack.PushCall("CreateRenderTarget", "");
+ TraceCallStack::NamedParams namedParams;
+ namedParams["surface"] << std::hex << renderTargetCreateInfo.surface;
+ mCallStack.PushCall("CreateRenderTarget", namedParams.str(), namedParams);
+
return Graphics::MakeUnique<TestGraphicsRenderTarget>(mGl, renderTargetCreateInfo);
}
return Graphics::MakeUnique<TestGraphicsRenderTarget>(mGl, renderTargetCreateInfo);
}
#define TEST_TRACE_CALL_STACK_H
/*
#define TEST_TRACE_CALL_STACK_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
+ const std::ostringstream& operator[](std::string name) const
+ {
+ static std::ostringstream empty;
+ auto iter = mParams.begin();
+ for(; iter != mParams.end(); ++iter)
+ {
+ if(!iter->parameterName.compare(name))
+ {
+ break;
+ }
+ }
+
+ if(iter != mParams.end())
+ {
+ return iter->value;
+ }
+ return empty;
+ }
+
std::string str() const
{
std::ostringstream out;
std::string str() const
{
std::ostringstream out;
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
-#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <toolkit-adaptor-impl.h>
#include <toolkit-lifecycle-controller.h>
namespace Dali
{
#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <toolkit-adaptor-impl.h>
#include <toolkit-lifecycle-controller.h>
namespace Dali
{
using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
-ToolkitTestApplication::ToolkitTestApplication( size_t surfaceWidth, size_t surfaceHeight, float horizontalDpi, float verticalDpi )
-: TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, false /* Do not Initialize Core */ ),
- mMainWindow( new Dali::Window ),
- mAdaptor( &AdaptorImpl::New() ) // Need to create Adaptor first as many singletons in dali-adaptor need it
+ToolkitTestApplication::ToolkitTestApplication(size_t surfaceWidth, size_t surfaceHeight, float horizontalDpi, float verticalDpi)
+: TestApplication(surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, false /* Do not Initialize Core */),
+ mMainWindow(new Dali::Window),
+ mAdaptor(&AdaptorImpl::New()) // Need to create Adaptor first as many singletons in dali-adaptor need it
{
// Create Core next
CreateCore();
// Override Scene creation in TestApplication by creating a window.
// The window will create a Scene & surface and set up the scene's surface appropriately.
{
// Create Core next
CreateCore();
// Override Scene creation in TestApplication by creating a window.
// The window will create a Scene & surface and set up the scene's surface appropriately.
- *mMainWindow = Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" );
- mScene = AdaptorImpl::GetScene( *mMainWindow );
- mScene.SetDpi( Vector2( horizontalDpi, verticalDpi ) );
+ *mMainWindow = Window::New(PositionSize(0, 0, surfaceWidth, surfaceHeight), "");
+ mScene = AdaptorImpl::GetScene(*mMainWindow);
+ mScene.SetDpi(Vector2(horizontalDpi, verticalDpi));
// Create render target for the scene
Graphics::RenderTargetCreateInfo rtInfo{};
// Create render target for the scene
Graphics::RenderTargetCreateInfo rtInfo{};
- rtInfo.SetExtent( {mSurfaceWidth, mSurfaceHeight });
- mRenderTarget = mGraphicsController.CreateRenderTarget( rtInfo, nullptr );
- mScene.SetSurfaceRenderTarget( mRenderTarget.get() );
+ rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
+ mScene.SetSurfaceRenderTarget(rtInfo);
// Core needs to be initialized next before we start the adaptor
InitializeCore();
Accessibility::Accessible::SetObjectRegistry(mCore->GetObjectRegistry());
// This will also emit the window created signals
// Core needs to be initialized next before we start the adaptor
InitializeCore();
Accessibility::Accessible::SetObjectRegistry(mCore->GetObjectRegistry());
// This will also emit the window created signals
- AdaptorImpl::GetImpl( *mAdaptor ).Start( *mMainWindow );
- AdaptorImpl::GetImpl( *mAdaptor ).SetApplication( *this );
+ AdaptorImpl::GetImpl(*mAdaptor).Start(*mMainWindow);
+ AdaptorImpl::GetImpl(*mAdaptor).SetApplication(*this);
Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
lifecycleController.InitSignal().Emit();
// set the DPI value for font rendering
TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
lifecycleController.InitSignal().Emit();
// set the DPI value for font rendering
TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
- fontClient.SetDpi( mDpi.x, mDpi.y );
+ fontClient.SetDpi(mDpi.x, mDpi.y);
void ToolkitTestApplication::RunIdles()
{
void ToolkitTestApplication::RunIdles()
{
- AdaptorImpl::GetImpl( *mAdaptor.get() ).RunIdles();
+ AdaptorImpl::GetImpl(*mAdaptor.get()).RunIdles();