1 // Copyright (C) 2016 The Android Open Source Project
2 //
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 #pragma once
16 
17 #include "host-common/opengl/emugl_config.h"
18 
19 #ifdef _MSC_VER
20 # ifdef BUILDING_EMUGL_COMMON_SHARED
21 #  define EMUGL_COMMON_API __declspec(dllexport)
22 # else
23 #  define EMUGL_COMMON_API __declspec(dllimport)
24 #endif
25 #else
26 # define EMUGL_COMMON_API
27 #endif
28 
29 namespace android {
30 
31 namespace base {
32 
33 class GLObjectCounter;
34 
35 } // namespace base
36 } // namespace android
37 
38 namespace emugl {
39     // Set/get GLES major/minor version.
40     EMUGL_COMMON_API void setGlesVersion(int maj, int min);
41     EMUGL_COMMON_API void getGlesVersion(int* maj, int* min);
42 
43     // Set/get renderer
44     EMUGL_COMMON_API void setRenderer(SelectedRenderer renderer);
45     EMUGL_COMMON_API SelectedRenderer getRenderer();
46 
47     // Extension string query
48     EMUGL_COMMON_API bool hasExtension(const char* extensionsStr,
49                       const char* wantedExtension);
50 
51     // GL object counter get/set
52     EMUGL_COMMON_API void setGLObjectCounter(
53             android::base::GLObjectCounter* counter);
54     EMUGL_COMMON_API android::base::GLObjectCounter* getGLObjectCounter();
55 
56     // Gralloc implementation get/set
57     EMUGL_COMMON_API void setGrallocImplementation(
58             GrallocImplementation gralloc);
59     EMUGL_COMMON_API GrallocImplementation getGrallocImplementation();
60 }
61