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 "multi_display_agent.h" 18 #include "window_agent.h" 19 #include "opengl/emugl_config.h" 20 21 #ifdef _MSC_VER 22 # ifdef BUILDING_EMUGL_COMMON_SHARED 23 # define EMUGL_COMMON_API __declspec(dllexport) 24 # else 25 # define EMUGL_COMMON_API __declspec(dllimport) 26 #endif 27 #else 28 # define EMUGL_COMMON_API 29 #endif 30 31 // List of values used to identify a clockwise 90-degree rotation. 32 typedef enum { 33 SKIN_ROTATION_0, 34 SKIN_ROTATION_90, 35 SKIN_ROTATION_180, 36 SKIN_ROTATION_270 37 } SkinRotation; 38 39 namespace android { 40 41 namespace base { 42 43 class CpuUsage; 44 class MemoryTracker; 45 class GLObjectCounter; 46 47 } // namespace base 48 } // namespace android 49 50 namespace emugl { 51 52 // Set and get API version of system image. 53 EMUGL_COMMON_API void setAvdInfo(bool isPhone, int apiLevel); 54 EMUGL_COMMON_API void getAvdInfo(bool* isPhone, int* apiLevel); 55 56 // Set/get GLES major/minor version. 57 EMUGL_COMMON_API void setGlesVersion(int maj, int min); 58 EMUGL_COMMON_API void getGlesVersion(int* maj, int* min); 59 60 // Set/get renderer 61 EMUGL_COMMON_API void setRenderer(SelectedRenderer renderer); 62 EMUGL_COMMON_API SelectedRenderer getRenderer(); 63 64 // Extension string query 65 EMUGL_COMMON_API bool hasExtension(const char* extensionsStr, 66 const char* wantedExtension); 67 68 // GL object counter get/set 69 EMUGL_COMMON_API void setGLObjectCounter( 70 android::base::GLObjectCounter* counter); 71 EMUGL_COMMON_API android::base::GLObjectCounter* getGLObjectCounter(); 72 73 // CPU usage get/set. 74 EMUGL_COMMON_API void setCpuUsage(android::base::CpuUsage* usage); 75 EMUGL_COMMON_API android::base::CpuUsage* getCpuUsage(); 76 77 // Memory usage get/set 78 EMUGL_COMMON_API void setMemoryTracker(android::base::MemoryTracker* usage); 79 EMUGL_COMMON_API android::base::MemoryTracker* getMemoryTracker(); 80 81 // Window operation agent 82 EMUGL_COMMON_API void set_emugl_window_operations(const QAndroidEmulatorWindowAgent &voperations); 83 EMUGL_COMMON_API const QAndroidEmulatorWindowAgent &get_emugl_window_operations(); 84 85 // MultiDisplay operation agent 86 EMUGL_COMMON_API void set_emugl_multi_display_operations(const QAndroidMultiDisplayAgent &operations); 87 EMUGL_COMMON_API const QAndroidMultiDisplayAgent &get_emugl_multi_display_operations(); 88 89 } 90