• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef WEBGL_SHADER_PRECISION_FORMAT_H_OBJECT_SOURCE_H
17 #define WEBGL_SHADER_PRECISION_FORMAT_H_OBJECT_SOURCE_H
18 
19 
20 #include <map>
21 #include "../context/webgl_rendering_context_basic_base.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 namespace OHOS {
28 namespace Rosen {
29 class ObjectSource {
30 public:
GetInstance()31     static ObjectSource& GetInstance()
32     {
33         static ObjectSource source;
34         return source;
35     }
36 
~ObjectSource()37     ~ObjectSource() {}
38 
GetObjectMap()39     std::map<int, std::string>& GetObjectMap()
40     {
41         return objects;
42     }
43 
44 private:
45     ObjectSource() = default;
46     ObjectSource(const ObjectSource&) = delete;
47     ObjectSource& operator=(const ObjectSource&) = delete;
48     std::map<int, std::string> objects;
49 };
50 } // namespace Rosen
51 } // namespace OHOS
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif // WEBGL_SHADER_PRECISION_FORMAT_H_OBJECT_SOURCE_H
58