Let we collect core creation status, instead of parameter increasement.
It will be useful when we add more features of Core.
Change-Id: I746bdb714eac5dcbd792a1a33a93abd2b96fe4cb
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
// We always need the first update!
mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING;
+ Integration::CorePolicyFlags corePolicyFlags = Integration::CorePolicyFlags::DEPTH_BUFFER_AVAILABLE | Integration::CorePolicyFlags::STENCIL_BUFFER_AVAILABLE;
+ if(mPartialUpdateEnabled)
+ {
+ corePolicyFlags |= Integration::CorePolicyFlags::PARTIAL_UPDATE_AVAILABLE;
+ }
+
mCore = Dali::Integration::Core::New(mRenderController,
mPlatformAbstraction,
mGraphicsController,
- Integration::RenderToFrameBuffer::FALSE,
- Integration::DepthBufferAvailable::TRUE,
- Integration::StencilBufferAvailable::TRUE,
- mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE);
+ corePolicyFlags);
mCore->ContextCreated();
#define DALI_INTEGRATION_CORE_ENUMERATIONS_H
/*
- * Copyright (c) 2023 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/common/bitwise-enum.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/integration-api/resource-policies.h>
#include <dali/public-api/common/dali-common.h>
TRUE
};
+/**
+ * The additional policy of core update / rendering process.
+ * @note Policy cannot be changed after the Core initialized.
+ */
+enum class CorePolicyFlags
+{
+ DEFAULT = 0, ///< Zero means that no additional policy is set.
+ RENDER_TO_FRAME_BUFFER = 1 << 0, ///< Whether we should render to the frame-buffer or not.
+ DEPTH_BUFFER_AVAILABLE = 1 << 1, ///< Whether the depth buffer is available or not.
+ STENCIL_BUFFER_AVAILABLE = 1 << 2, ///< Whether the stencil buffer is available or not.
+ PARTIAL_UPDATE_AVAILABLE = 1 << 3, ///< Whether the partial update is available or not.
+};
+
} // namespace Integration
+// specialization has to be done in the same namespace
+template<>
+struct EnableBitMaskOperators<Integration::CorePolicyFlags>
+{
+ static const bool ENABLE = true;
+};
} // namespace Dali
#endif // DALI_INTEGRATION_CORE_ENUMERATIONS_H
{
namespace Integration
{
-Core* Core::New(RenderController& renderController,
- PlatformAbstraction& platformAbstraction,
- Graphics::Controller& graphicsController,
- RenderToFrameBuffer renderToFboEnabled,
- DepthBufferAvailable depthBufferAvailable,
- StencilBufferAvailable stencilBufferAvailable,
- PartialUpdateAvailable partialUpdateAvailable)
+Core* Core::New(RenderController& renderController,
+ PlatformAbstraction& platformAbstraction,
+ Graphics::Controller& graphicsController,
+ CorePolicyFlags corePolicy)
{
Core* instance = new Core;
instance->mImpl = new Internal::Core(renderController,
platformAbstraction,
graphicsController,
- renderToFboEnabled,
- depthBufferAvailable,
- stencilBufferAvailable,
- partialUpdateAvailable);
+ corePolicy);
return instance;
}
* @param[in] renderController The interface to an object which controls rendering.
* @param[in] platformAbstraction The interface providing platform specific services.
* @param[in] graphicsController The interface providing graphics services
- * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
- * @param[in] depthBufferAvailable Whether the depth buffer is available
- * @param[in] stencilBufferAvailable Whether the stencil buffer is available
- * @param[in] partialUpdateAvailable Whether the partial update is available
+ * @param[in] corePolicy Flag list of update / rendering policies.
* @return A newly allocated Core.
*/
- static Core* New(RenderController& renderController,
- PlatformAbstraction& platformAbstraction,
- Graphics::Controller& graphicsController,
- RenderToFrameBuffer renderToFboEnabled,
- DepthBufferAvailable depthBufferAvailable,
- StencilBufferAvailable stencilBufferAvailable,
- PartialUpdateAvailable partialUpdateAvailable);
+ static Core* New(RenderController& renderController,
+ PlatformAbstraction& platformAbstraction,
+ Graphics::Controller& graphicsController,
+ CorePolicyFlags corePolicy);
/**
* Non-virtual destructor. Core is not intended as a base class.
using Integration::RenderStatus;
using Integration::UpdateStatus;
-Core::Core(RenderController& renderController,
- PlatformAbstraction& platform,
- Graphics::Controller& graphicsController,
- Integration::RenderToFrameBuffer renderToFboEnabled,
- Integration::DepthBufferAvailable depthBufferAvailable,
- Integration::StencilBufferAvailable stencilBufferAvailable,
- Integration::PartialUpdateAvailable partialUpdateAvailable)
+Core::Core(RenderController& renderController,
+ PlatformAbstraction& platform,
+ Graphics::Controller& graphicsController,
+ Integration::CorePolicyFlags corePolicy)
: mRenderController(renderController),
mPlatform(platform),
mGraphicsController(graphicsController),
mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
- mRenderManager = RenderManager::New(graphicsController, depthBufferAvailable, stencilBufferAvailable, partialUpdateAvailable);
+ mRenderManager = RenderManager::New(graphicsController,
+ (corePolicy & Integration::CorePolicyFlags::DEPTH_BUFFER_AVAILABLE) ? Integration::DepthBufferAvailable::TRUE : Integration::DepthBufferAvailable::FALSE,
+ (corePolicy & Integration::CorePolicyFlags::STENCIL_BUFFER_AVAILABLE) ? Integration::StencilBufferAvailable::TRUE : Integration::StencilBufferAvailable::FALSE,
+ (corePolicy & Integration::CorePolicyFlags::PARTIAL_UPDATE_AVAILABLE) ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE);
RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
- DALI_LOG_RELEASE_INFO("Node size: %lu\n", sizeof(Dali::Internal::SceneGraph::Node));
- DALI_LOG_RELEASE_INFO("Renderer size: %lu\n", sizeof(Dali::Internal::SceneGraph::Renderer));
- DALI_LOG_RELEASE_INFO("RenderItem size: %lu\n", sizeof(Dali::Internal::SceneGraph::RenderItem));
+ DALI_LOG_RELEASE_INFO("Core policy enum : 0x%x\n", static_cast<uint32_t>(corePolicy));
}
Core::~Core()
/**
* Create and initialise a new Core instance
*/
- Core(Integration::RenderController& renderController,
- Integration::PlatformAbstraction& platform,
- Graphics::Controller& graphicsController,
- Integration::RenderToFrameBuffer renderToFboEnabled,
- Integration::DepthBufferAvailable depthBufferAvailable,
- Integration::StencilBufferAvailable stencilBufferAvailable,
- Integration::PartialUpdateAvailable partialUpdateAvailable);
+ Core(Integration::RenderController& renderController,
+ Integration::PlatformAbstraction& platform,
+ Graphics::Controller& graphicsController,
+ Integration::CorePolicyFlags corePolicy);
/**
* Destructor