X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fcommon%2Fgraphics-interface.h;h=53fa46216b6265006262f64a1e8d5c8d11edf1e8;hb=815490375bbb42ef8454fa5f474268084e08b62f;hp=93c1b2f7a1360d591579d867b23f79493ccb2c0c;hpb=983ba5c09d1d0ca8f6c1abac6f2f88f4074af70f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/common/graphics-interface.h b/dali/internal/graphics/common/graphics-interface.h index 93c1b2f..53fa462 100644 --- a/dali/internal/graphics/common/graphics-interface.h +++ b/dali/internal/graphics/common/graphics-interface.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H /* - * Copyright (c) 2018 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. @@ -19,17 +19,19 @@ */ // INTERNAL INCLUDES -#include +#include #include +#include namespace Dali { +class RenderSurfaceInterface; namespace Internal { - namespace Adaptor { +class ConfigurationManager; /** * Factory interface for creating Graphics Factory implementation @@ -37,29 +39,78 @@ namespace Adaptor class GraphicsInterface { public: - /** * Constructor */ GraphicsInterface() -: mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ), - mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ) - { - }; + : mDepthBufferRequired(Integration::DepthBufferAvailable::FALSE), + mStencilBufferRequired(Integration::StencilBufferAvailable::FALSE), + mPartialUpdateRequired(Integration::PartialUpdateAvailable::FALSE){}; /** * Destructor */ - virtual ~GraphicsInterface() {} + virtual ~GraphicsInterface() = default; + + /** + * Returns controller object + * @return + */ + virtual Dali::Graphics::Controller& GetController() = 0; + + /** + * Initialize the graphics subsystem, configured from environment + */ + virtual void Initialize() = 0; + + /** + * Initialize the graphics subsystem, providing explicit parameters. + * + * @param[in] depth True if depth buffer is required + * @param[in] stencil True if stencil buffer is required + * @param[in] partialRendering True if partial rendering is required + * @param[in] msaa level of anti-aliasing required (-1 = off) + */ + virtual void Initialize(bool depth, bool stencil, bool partialRendering, int msaa) = 0; + + /** + * Configure the graphics surface + * + * @param[in] surface The surface to configure, or NULL if not present + */ + virtual void ConfigureSurface(Dali::RenderSurfaceInterface* surface) = 0; /** - * Initialize the graphics interface - * @param[in] environmentOptions The environment options. + * Activate the resource context */ - virtual void Initialize( EnvironmentOptions* environmentOptions ) = 0; + virtual void ActivateResourceContext() = 0; /** - * Destroy the Graphics Factory implementation + * Activate the surface context + * + * @param[in] surface The surface whose context to be switched to. + */ + virtual void ActivateSurfaceContext(Dali::RenderSurfaceInterface* surface) = 0; + + /** + * Inform graphics interface that all the surfaces have been rendered. + * + * @note This should not be called if uploading resource only without rendering any surface. + */ + virtual void PostRender() = 0; + + /** + * Inform graphics interface that this is the first frame after a resume. + */ + virtual void SetFirstFrameAfterResume() = 0; + + /** + * Shut down the graphics implementation + */ + virtual void Shutdown() = 0; + + /** + * Destroy the Graphics implementation */ virtual void Destroy() = 0; @@ -81,17 +132,75 @@ public: return mStencilBufferRequired; }; + /** + * Get whether the stencil buffer is required + * @return TRUE if the stencil buffer is required + */ + Integration::PartialUpdateAvailable GetPartialUpdateRequired() + { + return mPartialUpdateRequired; + }; -protected: + /** + * @return true if advanced blending options are supported + */ + virtual bool IsAdvancedBlendEquationSupported() = 0; + + /** + * @return true if multisampled render to texture is supported + */ + virtual bool IsMultisampledRenderToTextureSupported() = 0; + + /** + * @return true if graphics subsystem is initialized + */ + virtual bool IsInitialized() = 0; + + /** + * @return true if a separate resource context is supported + */ + virtual bool IsResourceContextSupported() = 0; + + /** + * @return the maximum texture size + */ + virtual uint32_t GetMaxTextureSize() = 0; - Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required - Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required + /** + * @return the maximum texture samples when we use multisampled texture + */ + virtual uint8_t GetMaxTextureSamples() = 0; + + /** + * @return the version number of the shader language + */ + virtual uint32_t GetShaderLanguageVersion() = 0; + + /** + * Store cached configurations + */ + virtual void CacheConfigurations(ConfigurationManager& configurationManager) = 0; + + /** + * Initialize data for logging frame info + */ + virtual void FrameStart() = 0; + + /** + * Log total capacity of memory pools during this frame + */ + virtual void LogMemoryPools() = 0; + +protected: + Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required + Integration::StencilBufferAvailable mStencilBufferRequired; ///< Whether the stencil buffer is required + Integration::PartialUpdateAvailable mPartialUpdateRequired; ///< Whether the partial update is required }; -} // Adaptor +} // namespace Adaptor -} // Internal +} // namespace Internal -} // Dali +} // namespace Dali #endif // DALI_INTERNAL_BASE_GRAPHICS_INTERFACE_H