X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Fintegration-api%2Fadaptor-framework%2Frender-surface-interface.h;h=2c7f6b7ba4cb3b4a1d4abaef4be79b365f994a64;hb=65b078a9ff82302a437788135fed9776ff856188;hp=01260b2977de3d151c4c7b72d36f1b9269090761;hpb=a4b02d85aa3afabe4718ff664f0c46b5aa28354b;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h old mode 100755 new mode 100644 index 01260b2..2c7f6b7 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -2,7 +2,7 @@ #define DALI_RENDER_SURFACE_INTERFACE_H /* - * Copyright (c) 2019 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. @@ -19,9 +19,14 @@ */ // EXTERNAL INCLUDES -#include #include +#include #include +#include +#include +#include +#include +#include namespace Dali { @@ -39,6 +44,12 @@ class GraphicsInterface; } /** + * @brief The position and size of the render surface. + */ +using PositionSize = Dali::Rect; +using SurfaceSize = Uint16Pair; + +/** * @brief Interface for a render surface onto which Dali draws. * * Dali::Adaptor requires a render surface to draw on to. This is @@ -51,10 +62,17 @@ class GraphicsInterface; * implementation of RenderSurface for the given platform */ -class RenderSurfaceInterface : public Dali::Integration::RenderSurface +class RenderSurfaceInterface { public: + enum Type + { + WINDOW_RENDER_SURFACE, + PIXMAP_RENDER_SURFACE, + NATIVE_RENDER_SURFACE + }; + /** * @brief Constructor * Inlined as this is a pure abstract interface @@ -63,6 +81,7 @@ public: : mAdaptor( nullptr ), mGraphics( nullptr ), mDisplayConnection( nullptr ), + mScene(), mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ), mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ) {} @@ -87,12 +106,6 @@ public: virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0; /** - * @brief Return the orientation of the surface. - * @return The orientation - */ - virtual int GetOrientation() const = 0; - - /** * @brief InitializeGraphics the platform specific graphics surface interfaces */ virtual void InitializeGraphics() = 0; @@ -129,9 +142,10 @@ public: * If the operation fails, then Core::Render should not be called until there is * a surface to render onto. * @param[in] resizingSurface True if the surface is being resized + * @param[in] damagedRects List of damaged rects this render pass * @return True if the operation is successful, False if the operation failed */ - virtual bool PreRender( bool resizingSurface ) = 0; + virtual bool PreRender( bool resizingSurface, const std::vector>& damagedRects, Rect& clippingRect ) = 0; /** * @brief Invoked by render thread after Core::Render @@ -139,7 +153,8 @@ public: * @param[in] replacingSurface True if the surface is being replaced. * @param[in] resizingSurface True if the surface is being resized. */ - virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) = 0; + virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector>& damagedRects ) = 0; + /** * @brief Invoked by render thread when the thread should be stop */ @@ -160,7 +175,7 @@ public: /** * @brief Gets the surface type */ - virtual Dali::Integration::RenderSurface::Type GetSurfaceType() = 0; + virtual Dali::RenderSurfaceInterface::Type GetSurfaceType() = 0; /** * @brief Makes the graphics context current @@ -179,18 +194,6 @@ public: */ virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0; - /** - * @brief Sets currentframe damaged rects - * @param[in] Sets currentframe damaged rects - * @param[out] return merged rect - */ - virtual void SetDamagedRect( const Dali::DamagedRect& damagedRect, Dali::DamagedRect& mergedRectArray ) = 0; - - /** - * @brief Gets buffer age - */ - virtual int32_t GetBufferAge() = 0; - public: void SetAdaptor( Dali::Internal::Adaptor::AdaptorInternalServices& adaptor ) @@ -208,6 +211,15 @@ public: mDisplayConnection = &displayConnection; } + /** + * @brief Sets a Scene that is rendered on this surface. + * @param scene The Scene object + */ + void SetScene( Dali::Integration::Scene& scene ) + { + mScene = scene; + } + private: /** @@ -225,6 +237,7 @@ protected: Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor; Dali::Internal::Adaptor::GraphicsInterface* mGraphics; Dali::DisplayConnection* mDisplayConnection; + WeakHandle< Dali::Integration::Scene > mScene; private: