X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles%2Fegl-graphics.h;h=1caa4a6bf1cf84f47d5d062c25f4e31525ea18c5;hb=177e1023cdb7fb21f9a9cfad861c1688c179eecd;hp=8ee45bc61755eb2d65adf725c2b847e884c94851;hpb=e1cd5273071896ce2a0fde47ab793e3cad2ffeac;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/gles/egl-graphics.h b/dali/internal/graphics/gles/egl-graphics.h index 8ee45bc..1caa4a6 100644 --- a/dali/internal/graphics/gles/egl-graphics.h +++ b/dali/internal/graphics/gles/egl-graphics.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -22,29 +22,29 @@ #include #include #include -#include -#include +#include #include #include #include +#include +#include namespace Dali { - namespace Internal { - namespace Adaptor { +class EnvironmentOptions; +class ConfigurationManager; class EglGraphics : public GraphicsInterface { public: - /** * Constructor */ - EglGraphics(); + EglGraphics(EnvironmentOptions& environmentOptions); /** * Destructor @@ -54,25 +54,54 @@ public: /** * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize() */ - void Initialize( EnvironmentOptions* environmentOptions ) override; + void Initialize() override; /** - * Creates the graphics interface for EGL - * @return The graphics interface for EGL + * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Initialize(bool,bool,bool,int) + */ + void Initialize(bool depth, bool stencil, bool partialRendering, int msaa); + + /** + * @copydoc Dali::Internal::Adaptor::GraphicsInterface::ConfigureSurface() */ - EglInterface* Create(); + void ConfigureSurface(Dali::RenderSurfaceInterface* surface) override; /** * Set gles version * Default version is gles 3.0 */ - void SetGlesVersion( const int32_t glesVersion ); + void SetGlesVersion(const int32_t glesVersion); /** * Set whether the surfaceless context is supported * @param[in] isSupported Whether the surfaceless context is supported */ - void SetIsSurfacelessContextSupported( const bool isSupported ); + void SetIsSurfacelessContextSupported(const bool isSupported); + + /** + * Activate the resource context (shared surfaceless context) + */ + void ActivateResourceContext() override; + + /** + * Activate the surface context + * + * @param[in] surface The surface whose context to be switched to. + */ + void ActivateSurfaceContext(Dali::RenderSurfaceInterface* surface) override; + + /** + * This is called after all the surfaces have been rendered. + * + * @note This should not be called if uploading resource only without rendering any surface. + */ + void PostRender() override; + + /** + * Inform graphics interface that this is the first frame after a resume. + * (For debug only) + */ + void SetFirstFrameAfterResume() override; /** * Gets the GL abstraction @@ -126,24 +155,71 @@ public: EglImageExtensions* GetImageExtensions(); /** + * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Shutdown() + */ + void Shutdown() override; + + /** * @copydoc Dali::Internal::Adaptor::GraphicsInterface::Destroy() */ void Destroy() override; + Graphics::Controller& GetController() override; + + bool IsAdvancedBlendEquationSupported() override + { + return mGLES->IsAdvancedBlendEquationSupported(); + } + + /** + * @return true if graphics subsystem is initialized + */ + bool IsInitialized() override + { + return mEglImplementation && mEglImplementation->IsGlesInitialized(); + } + + bool IsResourceContextSupported() override + { + return mEglImplementation && mEglImplementation->IsSurfacelessContextSupported(); + } + + uint32_t GetMaxTextureSize() override + { + return mGLES->GetMaxTextureSize(); + } + + uint32_t GetShaderLanguageVersion() override + { + return mGLES->GetShadingLanguageVersion(); + } + + const char* GetEglImageExtensionString() + { + return mGLES->GetEglImageExtensionString(); + } + + void CacheConfigurations(ConfigurationManager& configurationManager) override; + private: // Eliminate copy and assigned operations EglGraphics(const EglGraphics& rhs) = delete; EglGraphics& operator=(const EglGraphics& rhs) = delete; + /** + * Initialize graphics subsystems + */ + void EglInitialize(); private: - std::unique_ptr< GlImplementation > mGLES; ///< GL implementation - std::unique_ptr< EglImplementation > mEglImplementation; ///< EGL implementation - std::unique_ptr< EglImageExtensions > mEglImageExtensions; ///< EGL image extension - std::unique_ptr< EglSyncImplementation > mEglSync; ///< GlSyncAbstraction implementation for EGL - std::unique_ptr< EglContextHelperImplementation > mEglContextHelper; ///< GlContextHelperAbstraction implementation for EGL - - int mMultiSamplingLevel; ///< The multiple sampling level + Graphics::EglGraphicsController mGraphicsController; ///< Graphics Controller for Dali Core + std::unique_ptr mGLES; ///< GL implementation + std::unique_ptr mEglImplementation; ///< EGL implementation + std::unique_ptr mEglImageExtensions; ///< EGL image extension + std::unique_ptr mEglSync; ///< GlSyncAbstraction implementation for EGL + std::unique_ptr mEglContextHelper; ///< GlContextHelperAbstraction implementation for EGL + + int mMultiSamplingLevel; ///< The multiple sampling level }; } // namespace Adaptor