-#ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
-#define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#ifndef DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
+#define DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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>
+
// INTERNAL INCLUDES
-#include <dali/integration-api/egl-interface.h>
-#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/integration-api/adaptor-framework/egl-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <dali/internal/window-system/common/pixmap-render-surface.h>
#include <dali/internal/window-system/ubuntu-x11/ecore-x-types.h>
-#include <dali/public-api/dali-adaptor-common.h>
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/threading/conditional-wait.h>
-#include <Ecore_X.h>
namespace Dali
{
* Uses an X11 surface to render to.
* @param [in] positionSize the position and size of the surface
* @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
- * @param [in] name optional name of surface passed in
* @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
*/
- PixmapRenderSurfaceEcoreX( Dali::PositionSize positionSize,
- Any surface,
- const std::string& name,
- bool isTransparent = false);
+ PixmapRenderSurfaceEcoreX( Dali::PositionSize positionSize, Any surface, bool isTransparent = false );
/**
* @brief Destructor
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::GetSurface()
*/
- virtual Any GetSurface() override;
+ Any GetSurface() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::SetRenderNotification()
*/
- virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+ void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+
+public: // from Dali::RenderSurfaceInterface
-public: // from Dali::RenderSurface
+ /**
+ * @copydoc Dali::RenderSurfaceInterface::GetPositionSize()
+ */
+ PositionSize GetPositionSize() const override;
/**
- * @copydoc Dali::RenderSurface::GetPositionSize()
+ * @copydoc Dali::RenderSurfaceInterface::GetDpi()
*/
- virtual PositionSize GetPositionSize() const override;
+ void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
/**
- * @copydoc Dali::RenderSurface::GetDpi()
+ * @brief Return the orientation of the surface.
+ * @return The orientation
*/
- virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+ virtual int GetOrientation() const override;
/**
- * @copydoc Dali::RenderSurface::InitializeEgl()
+ * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics()
*/
- virtual void InitializeEgl( EglInterface& egl ) override;
+ void InitializeGraphics() override;
/**
- * @copydoc Dali::RenderSurface::CreateEglSurface()
+ * @copydoc Dali::RenderSurfaceInterface::CreateSurface()
*/
- virtual void CreateEglSurface( EglInterface& egl ) override;
+ void CreateSurface() override;
/**
- * @copydoc Dali::RenderSurface::DestroyEglSurface()
+ * @copydoc Dali::RenderSurfaceInterface::DestroySurface()
*/
- virtual void DestroyEglSurface( EglInterface& egl ) override;
+ void DestroySurface() override;
/**
- * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+ * @copydoc Dali::RenderSurfaceInterface::ReplaceGraphicsSurface()
*/
- virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+ bool ReplaceGraphicsSurface() override;
/**
- * @copydoc Dali::RenderSurface::MoveResize()
+ * @copydoc Dali::RenderSurfaceInterface::MoveResize()
*/
virtual void MoveResize( Dali::PositionSize positionSize) override {}
/**
- * @copydoc Dali::RenderSurface::SetViewMode()
+ * @copydoc Dali::RenderSurfaceInterface::StartRender()
*/
- void SetViewMode( ViewMode viewMode ) override {}
+ void StartRender() override;
/**
- * @copydoc Dali::RenderSurface::StartRender()
+ * @copydoc Dali::RenderSurfaceInterface::PreRender()
*/
- virtual void StartRender() override;
+ bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) override;
/**
- * @copydoc Dali::RenderSurface::PreRender()
+ * @copydoc Dali::RenderSurfaceInterface::PostRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+ void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) override;
/**
- * @copydoc Dali::RenderSurface::PostRender()
+ * @copydoc Dali::RenderSurfaceInterface::StopRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+ void StopRender() override;
/**
- * @copydoc Dali::RenderSurface::StopRender()
+ * @copydoc Dali::RenderSurfaceInterface::SetThreadSynchronization
*/
- virtual void StopRender() override;
+ void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
/**
- * @copydoc Dali::RenderSurface::SetThreadSynchronization
+ * @copydoc Dali::RenderSurfaceInterface::GetSurfaceType()
*/
- virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
+ Dali::RenderSurfaceInterface::Type GetSurfaceType() override;
/**
- * @copydoc Dali::RenderSurface::GetSurfaceType()
+ * @copydoc Dali::RenderSurfaceInterface::MakeContextCurrent()
*/
- virtual RenderSurface::Type GetSurfaceType() override;
+ void MakeContextCurrent() override;
private: // from PixmapRenderSurface
/**
- * @copydoc Dali::RenderSurface::ReleaseLock()
+ * @copydoc Dali::RenderSurfaceInterface::ReleaseLock()
*/
- virtual void ReleaseLock() override;
+ void ReleaseLock() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void Initialize( Any surface ) override;
+ void Initialize( Any surface ) override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void CreateRenderable() override;
+ void CreateRenderable() override;
/**
* @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
*/
- virtual void UseExistingRenderable( unsigned int surfaceId ) override;
+ void UseExistingRenderable( unsigned int surfaceId ) override;
private:
private: // Data
static const int BUFFER_COUNT = 2;
-
+ GraphicsInterface* mGraphics; ///< Graphics interface
+ Dali::DisplayConnection* mDisplayConnection; ///< Display connection
PositionSize mPosition; ///< Position
- std::string mTitle; ///< Title of window which shows from "xinfo -topvwins" command
TriggerEventInterface* mRenderNotification; ///< Render notification trigger
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)
} // namespace Dali
-#endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
+#endif // DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H