Dali 3D User Interface Engine
shader-factory.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_SHADER_FACTORY_H__
2 #define __DALI_INTERNAL_SHADER_FACTORY_H__
3 
4 /*
5  * Copyright (c) 2014 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 
21 // INTERNAL INCLUDES
27 
28 namespace Dali
29 {
30 
31 namespace Internal
32 {
33 
34 class ShaderData;
35 typedef IntrusivePtr<ShaderData> ShaderDataPtr;
36 
42 class ShaderFactory : public ShaderSaver
43 {
44 public:
45 
49  ShaderFactory();
50 
54  virtual ~ShaderFactory();
55 
71  Internal::ShaderDataPtr Load( const std::string& vertexSource, const std::string& fragmentSource, const Dali::Shader::ShaderHints hints, size_t& shaderHash );
72 
80  virtual void SaveBinary( Internal::ShaderDataPtr shader );
81 
85  void LoadDefaultShaders();
86 
87 private:
88 
89  void MemoryCacheInsert( Internal::ShaderData& shaderData );
90 
91  // Undefined
92  ShaderFactory( const ShaderFactory& );
93 
94  // Undefined
95  ShaderFactory& operator=( const ShaderFactory& rhs );
96 
97 private:
100 
101 }; // class ShaderFactory
102 
104 {
107  shaderData );
108 }
109 
110 } // namespace Internal
111 
112 } // namespace Dali
113 
114 #endif // __DALI_INTERNAL_SHADER_FACTORY_H__
Dali Docs Home
Read more about Dali