1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/intrusive-ptr.h>
25 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
34 typedef IntrusivePtr<ColorVisual> ColorVisualPtr;
37 * The visual which renders a solid color to the control's quad
39 * The following properties are required for create a ColorRender
41 * | %Property Name | Type |
42 * |-----------------|-------------|
43 * | mixColor | VECTOR4 |
45 class ColorVisual : public Visual::Base
49 * @brief Create a new color visual.
51 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
52 * @param[in] properties A Property::Map containing settings for this visual
53 * @return A smart-pointer to the newly allocated visual.
55 static ColorVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);
57 public: // from Visual
59 * @copydoc Visual::Base::CreatePropertyMap
61 void DoCreatePropertyMap(Property::Map& map) const override;
64 * @copydoc Visual::Base::CreateInstancePropertyMap
66 void DoCreateInstancePropertyMap(Property::Map& map) const override;
69 * @copydoc Visual::Base::EnablePreMultipliedAlpha
71 void EnablePreMultipliedAlpha(bool preMultiplied) override;
77 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
79 ColorVisual(VisualFactoryCache& factoryCache);
82 * @brief A reference counted object may only be deleted by calling Unreference().
84 virtual ~ColorVisual();
87 * @copydoc Visual::Base::OnInitialize
89 void OnInitialize() override;
92 * @copydoc Visual::Base::DoSetProperties
94 void DoSetProperties(const Property::Map& propertyMap) override;
97 * @copydoc Visual::Base::DoSetOnScene
99 void DoSetOnScene(Actor& actor) override;
102 * @copydoc Visual::Base::DoSetOffScene
104 void DoSetOffScene(Actor& actor) override;
107 * @copydoc Visual::Base::OnSetTransform
109 void OnSetTransform() override;
112 * @copydoc Visual::Base::UpdateShader
114 void UpdateShader() override;
117 * @copydoc Visual::Base::GenerateShader
119 Shader GenerateShader() const override;
122 * @copydoc Visual::Base::OnGetPropertyObject
124 Dali::Property OnGetPropertyObject(Dali::Property::Key key) override;
128 ColorVisual(const ColorVisual& colorRenderer);
131 ColorVisual& operator=(const ColorVisual& colorRenderer);
134 float mBlurRadius; ///< The blur radius
135 Property::Index mBlurRadiusIndex; ///< The blur radius property index
136 bool mAlwaysUsingBlurRadius : 1; ///< Whether we need the blur radius in shader always.
139 } // namespace Internal
141 } // namespace Toolkit
145 #endif /* DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H */