#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_SURFACE_ECORE_WL_H
/*
- * Copyright (c) 2020 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/threading/conditional-wait.h>
#include <tbm_surface.h>
#include <tbm_surface_queue.h>
-#include <dali/devel-api/threading/conditional-wait.h>
// INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
#include <dali/integration-api/adaptor-framework/egl-interface.h>
#include <dali/integration-api/adaptor-framework/native-render-surface.h>
#include <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/public-api/dali-adaptor-common.h>
namespace Dali
{
-
class DisplayConnection;
class EglInterface;
class NativeRenderSurfaceEcoreWl : public Dali::NativeRenderSurface
{
public:
-
/**
* Uses an Wayland surface to render to.
* @param [in] surfaceSize the size of the surface
* @param [in] surface the native surface handle
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
- NativeRenderSurfaceEcoreWl( SurfaceSize surfaceSize, Any surface, bool isTransparent = false );
+ NativeRenderSurfaceEcoreWl(SurfaceSize surfaceSize, Any surface, bool isTransparent = false);
/**
* @brief Destructor
virtual ~NativeRenderSurfaceEcoreWl();
public: // from WindowRenderSurface
-
- /**
- * @copydoc Dali::NativeRenderSurface::GetSurface()
- */
- Any GetDrawable() override;
-
/**
* @copydoc Dali::NativeRenderSurface::SetRenderNotification()
*/
- void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+ void SetRenderNotification(TriggerEventInterface* renderNotification) override;
/**
- * @copydoc Dali::NativeRenderSurface::WaitUntilSurfaceReplaced()
+ * @copydoc Dali::NativeRenderSurface::GetNativeRenderable()
*/
- void WaitUntilSurfaceReplaced() override;
+ virtual Any GetNativeRenderable() override;
public: // from Dali::RenderSurfaceInterface
-
/**
* @copydoc Dali::RenderSurfaceInterface::GetPositionSize()
*/
/**
* @copydoc Dali::RenderSurfaceInterface::GetDpi()
*/
- void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
+
+ /**
+ * @copydoc Dali::RenderSurfaceInterface::GetOrientation()
+ */
+ int GetOrientation() const override;
/**
* @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
/**
* @copydoc Dali::RenderSurfaceInterface::MoveResize()
*/
- void MoveResize( Dali::PositionSize positionSize) override;
+ void MoveResize(Dali::PositionSize positionSize) override;
/**
* @copydoc Dali::RenderSurfaceInterface::StartRender()
/**
* @copydoc Dali::RenderSurfaceInterface::PreRender()
*/
- bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
+ bool PreRender(bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect) override;
/**
* @copydoc Dali::RenderSurfaceInterface::PostRender()
*/
- void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
+ void PostRender() override;
/**
* @copydoc Dali::RenderSurfaceInterface::StopRender()
/**
* @copydoc Dali::RenderSurfaceInterface::SetThreadSynchronization
*/
- void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
+ void SetThreadSynchronization(ThreadSynchronizationInterface& threadSynchronization) override;
/**
* @copydoc Dali::RenderSurfaceInterface::GetSurfaceType()
Integration::StencilBufferAvailable GetStencilBufferRequired() override;
private:
-
/**
* @copydoc Dali::RenderSurfaceInterface::ReleaseLock()
*/
*/
void CreateNativeRenderable() override;
- /**
- * @copydoc Dali::NativeRenderSurface::ReleaseDrawable()
- */
- void ReleaseDrawable() override;
-
private: // Data
-
- SurfaceSize mSurfaceSize;
- TriggerEventInterface* mRenderNotification;
- Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
- EglInterface* mEGL;
- EGLSurface mEGLSurface;
- EGLContext mEGLContext;
- ColorDepth mColorDepth;
- tbm_format mTbmFormat;
- bool mOwnSurface;
- bool mDrawableCompleted;
-
- tbm_surface_queue_h mTbmQueue;
- tbm_surface_h mConsumeSurface;
- ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
- ConditionalWait mTbmSurfaceCondition;
-
+ SurfaceSize mSurfaceSize;
+ TriggerEventInterface* mRenderNotification;
+ Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
+ EglInterface* mEGL;
+ EGLSurface mEGLSurface;
+ EGLContext mEGLContext;
+ ColorDepth mColorDepth;
+ tbm_format mTbmFormat;
+ bool mOwnSurface;
+ std::vector<Rect<int>> mDamagedRects{}; ///< Keeps collected damaged render items rects for one render pass
+
+ tbm_surface_queue_h mTbmQueue;
+ ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
};
} // namespace Dali