X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcanvas-renderer%2Fubuntu%2Fcanvas-renderer-impl-ubuntu.h;h=e766d12c1c34d7fa0f6b4ae1d01ae8cb5da5444c;hb=eb2d65add1bdc7a3e38e3b102871c67984ee84fa;hp=b3ea4604b5abebceab011929cc7dd38674751891;hpb=a9aa390300b9c896c719c49888ab81f037c06b9d;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h b/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h index b3ea460..e766d12 100644 --- a/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h +++ b/dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_UBUNTU_CANVAS_RENDERER_IMPL_UBUNTU_H /* - * Copyright (c) 2021 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. @@ -22,14 +22,16 @@ #ifdef THORVG_SUPPORT #include #endif -#include +#include #include +#include // INTERNAL INCLUDES -#include -#include -#include +#include +#include #include +#include +#include namespace Dali { @@ -56,9 +58,9 @@ public: bool Commit() override; /** - * @copydoc Dali::CanvasRenderer::GetPixelBuffer() + * @copydoc Dali::CanvasRenderer::GetRasterizedTexture() */ - Devel::PixelBuffer GetPixelBuffer() override; + Dali::Texture GetRasterizedTexture() override; /** * @copydoc Dali::CanvasRenderer::AddDrawable() @@ -66,14 +68,44 @@ public: bool AddDrawable(Dali::CanvasRenderer::Drawable& drawable) override; /** + * @copydoc Dali::CanvasRenderer::IsCanvasChanged() + */ + bool IsCanvasChanged() const override; + + /** + * @copydoc Dali::CanvasRenderer::Rasterize() + */ + bool Rasterize() override; + + /** + * @copydoc Dali::CanvasRenderer::RemoveDrawable() + */ + bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable) override; + + /** + * @copydoc Dali::CanvasRenderer::RemoveAllDrawables() + */ + bool RemoveAllDrawables() override; + + /** * @copydoc Dali::CanvasRenderer::SetSize() */ - bool SetSize(const Vector2& size) override; + bool SetSize(Vector2 size) override; /** * @copydoc Dali::CanvasRenderer::GetSize() */ - const Vector2& GetSize() override; + Vector2 GetSize() const override; + + /** + * @copydoc Dali::CanvasRenderer::SetViewBox() + */ + bool SetViewBox(const Vector2& viewBox) override; + + /** + * @copydoc Dali::CanvasRenderer::GetViewBox() + */ + const Vector2& GetViewBox() override; private: CanvasRendererUbuntu() = delete; @@ -104,16 +136,41 @@ private: */ void MakeTargetBuffer(const Vector2& size); -private: - Devel::PixelBuffer mPixelBuffer; +#ifdef THORVG_SUPPORT + /** + * @brief Get drawables changed status. + * If drawable is a type that can have child drawables, it is called recursively. + * @param[in] drawable The drawable object. + * @return Returns whether drawables have changed. + */ + bool HaveDrawablesChanged(const Dali::CanvasRenderer::Drawable& drawable) const; + /** + * @brief Update drawables changed status. + * If drawable is a type that can have child drawables, it is called recursively. + * @param[in] drawable The drawable object. + * @param[in] changed The state of changed. + */ + void UpdateDrawablesChanged(Dali::CanvasRenderer::Drawable& drawable, bool changed); + + /** + * @brief Push drawable object to parent. + * If drawable is a type that can have child drawables, it is called recursively. + * @param[in] drawable The drawable object. + * @param[in] group The scene object of tvg that can be drawable group. + */ + void PushDrawableToGroup(Dali::CanvasRenderer::Drawable& drawable, tvg::Scene* group); +#endif + +private: #ifdef THORVG_SUPPORT + Devel::PixelBuffer mPixelBuffer; + Dali::Texture mRasterizedTexture; + Dali::Mutex mMutex; std::unique_ptr mTvgCanvas; tvg::Scene* mTvgRoot; #endif - typedef std::vector > DrawableVector; - typedef DrawableVector::iterator DrawableVectorIterator; - DrawableVector mDrawables; + DrawableGroup::DrawableVector mDrawables; Vector2 mSize; Vector2 mViewBox;