From: subhransu mohanty Date: Tue, 15 Jan 2019 06:52:04 +0000 (+0900) Subject: lottie/vector: Added texture and transformation support in brush. X-Git-Tag: submit/tizen/20190116.045417~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F197676%2F1;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/vector: Added texture and transformation support in brush. Change-Id: I4e433a8f09342051a9ec062f45184709e578fd98 --- diff --git a/src/vector/vbrush.cpp b/src/vector/vbrush.cpp index c1a3dc9..ca2df7b 100644 --- a/src/vector/vbrush.cpp +++ b/src/vector/vbrush.cpp @@ -85,7 +85,7 @@ VBrush::VBrush(int r, int g, int b, int a) { } -VBrush::VBrush(const VGradient *gradient) : mType(VBrush::Type::NoBrush) +VBrush::VBrush(const VGradient *gradient) { if (!gradient) return; @@ -98,4 +98,17 @@ VBrush::VBrush(const VGradient *gradient) : mType(VBrush::Type::NoBrush) } } +VBrush::VBrush(const VBitmap &texture) +{ + if (!texture.valid()) return; + + mType = VBrush::Type::Texture; + mTexture = texture; +} + +void VBrush::setMatrix(const VMatrix &m) +{ + mMatrix = m; +} + V_END_NAMESPACE diff --git a/src/vector/vbrush.h b/src/vector/vbrush.h index f6a07d4..348e2ec 100644 --- a/src/vector/vbrush.h +++ b/src/vector/vbrush.h @@ -23,6 +23,7 @@ #include "vglobal.h" #include "vmatrix.h" #include "vpoint.h" +#include "vbitmap.h" V_BEGIN_NAMESPACE @@ -78,12 +79,15 @@ public: VBrush(const VColor &color); VBrush(const VGradient *gradient); VBrush(int r, int g, int b, int a); + VBrush(const VBitmap &texture); inline VBrush::Type type() const { return mType; } - + void setMatrix(const VMatrix &m); public: VBrush::Type mType{Type::NoBrush}; VColor mColor; const VGradient *mGradient{nullptr}; + VBitmap mTexture; + VMatrix mMatrix; }; V_END_NAMESPACE