projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Show the broken image in case of invalid svg files
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
svg
/
svg-visual.h
diff --git
a/dali-toolkit/internal/visuals/svg/svg-visual.h
b/dali-toolkit/internal/visuals/svg/svg-visual.h
index
e516186
..
5910ff2
100644
(file)
--- a/
dali-toolkit/internal/visuals/svg/svg-visual.h
+++ b/
dali-toolkit/internal/visuals/svg/svg-visual.h
@@
-2,7
+2,7
@@
#define DALI_TOOLKIT_INTERNAL_SVG_VISUAL_H
/*
#define DALI_TOOLKIT_INTERNAL_SVG_VISUAL_H
/*
- * Copyright (c) 20
17
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-26,8
+26,6
@@
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
-struct NSVGimage;
-
namespace Dali
{
namespace Dali
{
@@
-87,17
+85,17
@@
public: // from Visual
/**
* @copydoc Visual::Base::GetNaturalSize
*/
/**
* @copydoc Visual::Base::GetNaturalSize
*/
- v
irtual void GetNaturalSize( Vector2& naturalSize )
;
+ v
oid GetNaturalSize( Vector2& naturalSize ) override
;
/**
* @copydoc Visual::Base::CreatePropertyMap
*/
/**
* @copydoc Visual::Base::CreatePropertyMap
*/
- v
irtual void DoCreatePropertyMap( Property::Map& map ) const
;
+ v
oid DoCreatePropertyMap( Property::Map& map ) const override
;
/**
* @copydoc Visual::Base::CreateInstancePropertyMap
*/
/**
* @copydoc Visual::Base::CreateInstancePropertyMap
*/
- v
irtual void DoCreateInstancePropertyMap( Property::Map& map ) const
;
+ v
oid DoCreateInstancePropertyMap( Property::Map& map ) const override
;
protected:
protected:
@@
-106,8
+104,9
@@
protected:
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
*
* @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
*/
*/
- SvgVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory );
+ SvgVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory
, const VisualUrl& imageUrl
);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
/**
* @brief A reference counted object may only be deleted by calling Unreference().
@@
-115,42
+114,51
@@
protected:
virtual ~SvgVisual();
/**
virtual ~SvgVisual();
/**
+ * @copydoc Visual::Base::OnInitialize
+ */
+ void OnInitialize() override;
+
+ /**
* @copydoc Visual::Base::DoSetProperties
*/
* @copydoc Visual::Base::DoSetProperties
*/
- v
irtual void DoSetProperties( const Property::Map& propertyMap )
;
+ v
oid DoSetProperties( const Property::Map& propertyMap ) override
;
/**
/**
- * @copydoc Visual::Base::DoSetOnS
tag
e
+ * @copydoc Visual::Base::DoSetOnS
cen
e
*/
*/
- v
irtual void DoSetOnStage( Actor& actor )
;
+ v
oid DoSetOnScene( Actor& actor ) override
;
/**
/**
- * @copydoc Visual::Base::DoSetOffS
tag
e
+ * @copydoc Visual::Base::DoSetOffS
cen
e
*/
*/
- v
irtual void DoSetOffStage( Actor& actor )
;
+ v
oid DoSetOffScene( Actor& actor ) override
;
/**
* @copydoc Visual::Base::OnSetTransform
*/
/**
* @copydoc Visual::Base::OnSetTransform
*/
- virtual void OnSetTransform();
+ void OnSetTransform() override;
+
+ /**
+ * @copydoc Visual::Base::IsResourceReady
+ */
+ bool IsResourceReady() const override;
public:
/**
* @bried Apply the rasterized image to the visual.
*
public:
/**
* @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] rasterizedPixelData The pixel buffer with the rasterized pixels
+ * @param[in] bool Whether the resource is loaded
*/
*/
- void ApplyRasterizedImage(
PixelData rasterizedPixelData
);
+ void ApplyRasterizedImage(
VectorImageRenderer vectorImage, PixelData rasterizedPixelData, bool isLoaded
);
private:
private:
-
/**
/**
- * @brief Parses the SVG Image from the set URL.
- *
- * @param[in] imageUrl The URL of the image to parse the SVG from.
+ * @brief Load the SVG Image from the set URL.
*/
*/
- void
ParseFromUrl( const VisualUrl& imageUrl
);
+ void
Load(
);
/**
* @bried Rasterize the svg with the given size, and add it to the visual.
/**
* @bried Rasterize the svg with the given size, and add it to the visual.
@@
-166,7
+174,6
@@
private:
*/
void DoSetProperty( Property::Index index, const Property::Value& value );
*/
void DoSetProperty( Property::Index index, const Property::Value& value );
-
// Undefined
SvgVisual( const SvgVisual& svgRenderer );
// Undefined
SvgVisual( const SvgVisual& svgRenderer );
@@
-177,9
+184,12
@@
private:
ImageVisualShaderFactory& mImageVisualShaderFactory;
Vector4 mAtlasRect;
VisualUrl mImageUrl;
ImageVisualShaderFactory& mImageVisualShaderFactory;
Vector4 mAtlasRect;
VisualUrl mImageUrl;
- NSVGimage* mParsedImage;
+ VectorImageRenderer mVectorRenderer;
+ uint32_t mDefaultWidth;
+ uint32_t mDefaultHeight;
WeakHandle<Actor> mPlacementActor;
Vector2 mVisualSize;
WeakHandle<Actor> mPlacementActor;
Vector2 mVisualSize;
+ bool mLoadFailed;
bool mAttemptAtlasing; ///< If true will attempt atlasing, otherwise create unique texture
};
bool mAttemptAtlasing; ///< If true will attempt atlasing, otherwise create unique texture
};