diff --git a/inc/thorvg.h b/inc/thorvg.h index 271ed507..ba1d98bc 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -301,6 +301,7 @@ public: uint8_t opacity() const noexcept; _TVG_DECLARE_ACCESSOR(); + _TVG_DECALRE_IDENTIFIER(); _TVG_DECLARE_PRIVATE(Paint); }; diff --git a/src/lib/tvgCommon.h b/src/lib/tvgCommon.h index 28dbeac7..1be9fb14 100644 --- a/src/lib/tvgCommon.h +++ b/src/lib/tvgCommon.h @@ -31,6 +31,9 @@ using namespace tvg; #define FILL_ID_LINEAR 0 #define FILL_ID_RADIAL 1 +#define PAINT_ID_SHAPE 0 +#define PAINT_ID_SCENE 1 +#define PAINT_ID_PICTURE 2 //for MSVC Compat #ifdef _MSC_VER @@ -41,4 +44,4 @@ using namespace tvg; #define TVG_UNUSED __attribute__ ((__unused__)) #endif -#endif //_TVG_COMMON_H_ \ No newline at end of file +#endif //_TVG_COMMON_H_ diff --git a/src/lib/tvgPaint.h b/src/lib/tvgPaint.h index b0dadd2e..76f01b8e 100644 --- a/src/lib/tvgPaint.h +++ b/src/lib/tvgPaint.h @@ -27,8 +27,6 @@ namespace tvg { - enum class PaintType { Shape = 0, Scene, Picture }; - struct StrategyMethod { virtual ~StrategyMethod() {} @@ -48,7 +46,6 @@ namespace tvg uint32_t flag = RenderUpdateFlag::None; Paint* cmpTarget = nullptr; CompositeMethod cmpMethod = CompositeMethod::None; - PaintType type; uint8_t opacity = 255; ~Impl() { diff --git a/src/lib/tvgPicture.cpp b/src/lib/tvgPicture.cpp index 6f10c6f4..d007253b 100644 --- a/src/lib/tvgPicture.cpp +++ b/src/lib/tvgPicture.cpp @@ -28,7 +28,7 @@ Picture::Picture() : pImpl(new Impl(this)) { - Paint::pImpl->type = PaintType::Picture; + _id = PAINT_ID_PICTURE; Paint::pImpl->method(new PaintMethod(pImpl)); } diff --git a/src/lib/tvgScene.cpp b/src/lib/tvgScene.cpp index 20821211..4f3699ff 100644 --- a/src/lib/tvgScene.cpp +++ b/src/lib/tvgScene.cpp @@ -27,7 +27,7 @@ Scene::Scene() : pImpl(new Impl()) { - Paint::pImpl->type = PaintType::Scene; + _id = PAINT_ID_SCENE; Paint::pImpl->method(new PaintMethod(pImpl)); } @@ -67,4 +67,4 @@ Result Scene::clear(bool free) noexcept pImpl->clear(free); return Result::Success; -} \ No newline at end of file +} diff --git a/src/lib/tvgSceneImpl.h b/src/lib/tvgSceneImpl.h index 6487bec8..1ea4c99e 100644 --- a/src/lib/tvgSceneImpl.h +++ b/src/lib/tvgSceneImpl.h @@ -60,7 +60,7 @@ struct Scene::Impl //If scene has several children or only scene, it may require composition. if (paints.count > 1) return true; - if (paints.count == 1 && (*paints.data)->pImpl->type == PaintType::Scene) return true; + if (paints.count == 1 && (*paints.data)->id() == PAINT_ID_SCENE) return true; return false; } diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index daf31acc..0af9ca1c 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -38,7 +38,7 @@ constexpr auto PATH_KAPPA = 0.552284f; Shape :: Shape() : pImpl(new Impl(this)) { - Paint::pImpl->type = PaintType::Shape; + _id = PAINT_ID_SHAPE; Paint::pImpl->method(new PaintMethod(pImpl)); }