X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fcanvas-view%2Fcanvas-view-impl.h;h=6f0fa11dba01d0f96d5abfeba43b199232674540;hb=HEAD;hp=b2d5775e091794d92a74f1329dffe15aed0a4c07;hpb=ac501f02feab8e2fb7e613f936d3d5a511603001;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.h b/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.h index b2d5775..6f0fa11 100644 --- a/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.h +++ b/dali-toolkit/internal/controls/canvas-view/canvas-view-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_CANVAS_VIEW_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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,24 +19,26 @@ */ // EXTERNAL INCLUDES -#include -#include -#include +#include +#include +#include #include #include // INTERNAL INCLUDES #include +#include #include namespace Dali { namespace Toolkit { -class CanvasView; - namespace Internal { +class CanvasView; +class CanvasViewRasterizeThread; + class CanvasView : public Control, public Integration::Processor { public: @@ -62,6 +64,32 @@ public: */ bool AddDrawable(Dali::CanvasRenderer::Drawable& drawable); + /** + * Called when a property of an object of this type is set. + * @param[in] object The object whose property is set. + * @param[in] propertyIndex The property index. + * @param[in] value The new property value. + */ + static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value); + + /** + * Called to retrieve a property of an object of this type. + * @param[in] object The object whose property is to be retrieved. + * @param[in] propertyIndex The property index. + * @return The current value of the property. + */ + static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex); + + /** + * @copydoc Toolkit::Control::CanvasView::RemoveDrawable + */ + bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable); + + /** + * @copydoc Toolkit::Control::CanvasView::RemoveAllDrawables + */ + bool RemoveAllDrawables(); + private: // From Control /** * @copydoc Control::OnRelayout @@ -78,27 +106,73 @@ private: // From Control */ void OnInitialize() override; -protected: // Implementation of Processor + /** + * @brief This is the viewbox of the Canvas. + * @param[in] viewBox The size of viewbox. + * @return Returns True when it's successful. False otherwise. + */ + bool SetViewBox(const Vector2& viewBox); + + /** + * @brief This is the viewbox of the Canvas. + * @return Returns The size of viewbox. + */ + const Vector2& GetViewBox(); + + /** + * @brief Set to load the canvas synchronously. + * + * @param isSynchronous The synchronous + */ + void SetSynchronous(const bool isSynchronous); + + /** + * @brief Whether to load the canvas synchronously. + * + * @return Returns true if synchronously. + */ + const bool IsSynchronous(); + + /** + * @bried Rasterize the canvas, and add it to the view. + * + * @param[in] size The target size of the canvas view rasterization. + */ + void AddRasterizationTask(); + +protected: /** * @copydoc Dali::Integration::Processor::Process() */ void Process(bool postProcessor) override; -private: /** - * @brief Draw drawables added to CanvasView on inner canvas. - * Then make that buffer into a texture and add it to renderer. + * @copydoc Dali::Integration::Processor::GetProcessorName() + */ + std::string_view GetProcessorName() const override + { + return "CanvasView"; + } + +public: + /** + * @bried Apply the rasterized image to the canvas view + * + * @param[in] task CanvasRendererRasterizingTaskPtr */ - void Commit(); + void ApplyRasterizedImage(CanvasRendererRasterizingTaskPtr task); private: CanvasView(const CanvasView&) = delete; CanvasView& operator=(const CanvasView&) = delete; private: - CanvasRenderer mCanvasRenderer; - Dali::Texture mTexture; - bool mChanged; + CanvasRenderer mCanvasRenderer; + Dali::Texture mTexture; + TextureSet mTextureSet; + Vector2 mSize; + CanvasRendererRasterizingTaskPtr mRasterizingTask; + bool mIsSynchronous; }; } // namespace Internal