320528c88dc301306237fd1e394d3c3293ede15b
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / control / control-renderers.h
1 #ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
2 #define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
20 #include <dali/dali.h>
21
22 namespace Dali
23 {
24 namespace Toolkit
25 {
26 namespace Internal
27 {
28
29 extern const char* const BASIC_VERTEX_SOURCE;
30
31 extern const char* const BASIC_FRAGMENT_SOURCE;
32
33 /**
34  * Helper method for rendering an image with custom shader.
35  * @param[in] vertextSrc The custom vertex shader.
36  * @param[in] fragmentSrc The custom fragment shader.
37  * @return A newly created renderer.
38  */
39 Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc );
40
41 /**
42  * Helper method for rendering an image with custom shader.
43  * @param[in] vertextSrc The custom vertex shader.
44  * @param[in] fragmentSrc The custom fragment shader.
45  * @param[in] gridSize The number of grid sub-divisions required.
46  * @return A newly created renderer.
47  */
48 Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc, Dali::Shader::Hint::Value hints, Dali::Uint16Pair gridSize );
49
50 /**
51  * Helper method for setting the first texture passed to a renderer.
52  * @param[in] renderer The renderer using the texture.
53  * @param[in] texture The texture to set.
54  */
55 void SetRendererTexture( Dali::Renderer renderer, Dali::Texture texture );
56
57 /**
58  * Helper method for setting the first texture passed to a renderer.
59  * @param[in] renderer The renderer using the texture.
60  * @param[in] framebuffer A frame buffer color texture attached.
61  */
62 void SetRendererTexture( Dali::Renderer renderer, Dali::FrameBuffer frameBuffer );
63
64 } // namespace Internal
65 } // namespace Toolkit
66 } // namespace Dali
67
68 #endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H