2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/canvas-renderer/common/drawable-factory.h>
20 #include <dali/internal/canvas-renderer/common/drawable-impl.h>
28 Drawable::Drawable() = default;
38 void Drawable::Create()
42 mImpl = Internal::Adaptor::DrawableFactory::New();
46 bool Drawable::SetOpacity(float opacity)
52 return mImpl->SetOpacity(opacity);
55 float Drawable::GetOpacity() const
61 return mImpl->GetOpacity();
64 bool Drawable::Rotate(Degree degree)
70 return mImpl->Rotate(degree);
73 bool Drawable::Scale(float factor)
79 return mImpl->Scale(factor);
82 bool Drawable::Translate(Vector2 translate)
88 return mImpl->Translate(translate);
91 bool Drawable::Transform(const Dali::Matrix3& matrix)
97 return mImpl->Transform(matrix);
100 Rect<float> Drawable::GetBoundingBox() const
104 return Rect<float>(0, 0, 0, 0);
106 return mImpl->GetBoundingBox();
109 bool Drawable::SetClipPath(Dali::CanvasRenderer::Drawable& clip)
115 return mImpl->SetClipPath(clip);
118 bool Drawable::SetMask(Dali::CanvasRenderer::Drawable& mask, Dali::CanvasRenderer::Drawable::MaskType type)
124 return mImpl->SetMask(mask, type);
127 Dali::CanvasRenderer::Drawable Drawable::GetCompositionDrawable() const
131 return Dali::CanvasRenderer::Drawable();
133 return mImpl->GetCompositionDrawable();
136 Dali::Internal::Adaptor::Drawable::CompositionType Drawable::GetCompositionType() const
140 return Dali::Internal::Adaptor::Drawable::CompositionType::NONE;
142 return mImpl->GetCompositionType();
145 void Drawable::SetAdded(bool added)
151 mImpl->SetAdded(added);
154 bool Drawable::IsAdded() const
160 return mImpl->IsAdded();
163 void* Drawable::GetObject() const
169 return mImpl->GetObject();
172 void Drawable::SetObject(const void* object)
178 mImpl->SetObject(object);
181 void Drawable::SetChanged(bool changed)
187 mImpl->SetChanged(changed);
190 bool Drawable::GetChanged() const
196 return mImpl->GetChanged();
199 void Drawable::SetType(Drawable::Types type)
205 mImpl->SetType(type);
208 Drawable::Types Drawable::GetType() const
212 return Drawable::Types::NONE;
214 return mImpl->GetType();
217 Dali::Internal::Adaptor::Drawable* Drawable::GetImplementation()
222 } // namespace Adaptor
224 } // namespace Internal