1 #ifndef __DALI_INTERNAL_SHADER_FACTORY_H__
2 #define __DALI_INTERNAL_SHADER_FACTORY_H__
5 * Copyright (c) 2014 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/internal/event/resources/resource-ticket.h>
23 #include <dali/internal/event/resources/resource-type-path-id-map.h>
24 #include <dali/internal/event/effects/shader-declarations.h>
33 class MessageController;
36 * ShaderFactory is an object that manages shader binary resource load requests,
37 * It triggers the load requests during core initialization and sends a message to the
38 * render manager with information about all the requested shader binaries and their
48 ShaderFactory(ResourceClient& resourceClient);
56 * Issues a request to load a binary version of a shader program, and returns a resource ticket
57 * If a request for an identical shader has already been made, the ticket for the older request
59 * @param [in] vertexSource The vertex shader source code
60 * @param [in] fragmentSource The fragment shader source code
61 * @param [out] shaderHash hash key created with vertex and fragment shader code
62 * @return A ticket for the resource
64 ResourceTicketPtr Load( const std::string& vertexSource, const std::string& fragmentSource, size_t& shaderHash );
67 * Called during Core initialization to load the default shader.
69 void LoadDefaultShaders();
74 ShaderFactory( const ShaderFactory& );
77 ShaderFactory& operator=( const ShaderFactory& rhs );
80 ResourceClient& mResourceClient;
81 ResourceTypePathIdMap mResourceTypePathIdMap; ///< A map of resource IDs sorted by ResourceTypePath
82 ShaderEffectPtr mDefaultShader;
84 }; // class ShaderFactory
86 } // namespace Internal
90 #endif // __DALI_INTERNAL_SHADER_FACTORY_H__