[Adaptation Layer] Added rive-tizen adaptation layer class.
[platform/core/uifw/rive-tizen.git] / submodule / src / shapes / paint / shape_paint.cpp
1 #include "shapes/paint/shape_paint.hpp"
2 #include "shapes/shape_paint_container.hpp"
3
4 #include "renderer.hpp"
5
6 using namespace rive;
7
8 ShapePaint::~ShapePaint() { delete m_RenderPaint; }
9
10 StatusCode ShapePaint::onAddedClean(CoreContext* context)
11 {
12         auto container = ShapePaintContainer::from(parent());
13         if (container == nullptr)
14         {
15                 return StatusCode::MissingObject;
16         }
17         container->addPaint(this);
18         return StatusCode::Ok;
19 }
20
21 RenderPaint* ShapePaint::initRenderPaint(ShapePaintMutator* mutator)
22 {
23         assert(m_RenderPaint == nullptr);
24         m_PaintMutator = mutator;
25         return m_RenderPaint = makeRenderPaint();
26 }
27
28 void ShapePaint::blendMode(BlendMode value)
29 {
30         assert(m_RenderPaint != nullptr);
31         m_RenderPaint->blendMode(value);
32 }