// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
+#include <dali-toolkit/internal/visuals/svg/svg-task.h>
namespace Dali
{
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
* @param[in] imageUrl The URL to svg resource to use
+ * @param[in] size The width and height of the rasterized buffer. The visual size will be used if these are 0.
* @return A smart-pointer to the newly allocated visual.
*/
- static SvgVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl);
+ static SvgVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, ImageDimensions size = ImageDimensions());
public: // from Visual
/**
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
* @param[in] imageUrl The URL to svg resource to use
+ * @param[in] size The width and height of the rasterized buffer. The visual size will be used if these are 0.
*/
- SvgVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl);
+ SvgVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, ImageDimensions size);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
/**
* @bried Apply the rasterized image to the visual.
*
- * @param[in] vectorImage The data of vector image.
- * @param[in] rasterizedPixelData The pixel buffer with the rasterized pixels
- * @param[in] bool Whether the resource is loaded
+ * @param[in] task SvgTaskPtr
*/
- void ApplyRasterizedImage(VectorImageRenderer vectorImage, PixelData rasterizedPixelData, bool isLoaded);
+ void ApplyRasterizedImage(SvgTaskPtr task);
private:
/**
- * @brief Load the SVG Image from the set URL.
- */
- void Load();
-
- /**
* @bried Rasterize the svg with the given size, and add it to the visual.
*
* @param[in] size The target size of the SVG rasterization.
uint32_t mDefaultWidth;
uint32_t mDefaultHeight;
WeakHandle<Actor> mPlacementActor;
- Vector2 mVisualSize;
+ Vector2 mRasterizedSize;
+ Dali::ImageDimensions mDesiredSize{};
+ SvgTaskPtr mLoadingTask;
+ SvgTaskPtr mRasterizingTask;
bool mLoadFailed;
bool mAttemptAtlasing; ///< If true will attempt atlasing, otherwise create unique texture
};