1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H
5 * Copyright (c) 2016 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>
37 typedef IntrusivePtr< ColorVisual > ColorVisualPtr;
40 * The visual which renders a solid color to the control's quad
42 * The following properties are required for create a ColorRender
44 * | %Property Name | Type |
45 * |-----------------|-------------|
46 * | mixColor | VECTOR4 |
48 class ColorVisual: public Visual::Base
53 * @brief Create a new color visual.
55 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
56 * @param[in] properties A Property::Map containing settings for this visual
57 * @return A smart-pointer to the newly allocated visual.
59 static ColorVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
61 public: // from Visual
64 * @copydoc Visual::Base::CreatePropertyMap
66 virtual void DoCreatePropertyMap( Property::Map& map ) const;
73 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
75 ColorVisual( VisualFactoryCache& factoryCache );
78 * @brief A reference counted object may only be deleted by calling Unreference().
80 virtual ~ColorVisual();
83 * @copydoc Visual::Base::DoSetProperties
85 virtual void DoSetProperties( const Property::Map& propertyMap );
88 * @copydoc Visual::Base::DoSetOnStage
90 virtual void DoSetOnStage( Actor& actor );
93 * @copydoc Visual::Base::OnSetTransform
95 virtual void OnSetTransform();
100 * Set the color for rendering.
101 * @param[in] color The color to be rendered.
103 void SetColor( const Vector4& color );
107 * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
109 void InitializeRenderer();
114 ColorVisual( const ColorVisual& colorRenderer );
117 ColorVisual& operator=( const ColorVisual& colorRenderer );
122 Property::Index mMixColorIndex;
126 } // namespace Internal
128 } // namespace Toolkit
132 #endif /* DALI_TOOLKIT_INTERNAL_COLOR_VISUAL_H */