1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include "misc.h" 18 #include "GraphicsAgentFactory.h" 19 #include <cassert> 20 21 namespace { 22 23 QAndroidEmulatorWindowAgent g_window_operations; 24 QAndroidMultiDisplayAgent g_multi_display_operations; 25 static bool g_window_initialized = false; 26 static bool g_multi_display_initialized = false; 27 28 } // namespace 29 set_emugl_window_operations(const QAndroidEmulatorWindowAgent & operations)30void emugl::set_emugl_window_operations(const QAndroidEmulatorWindowAgent &operations) 31 { 32 g_window_operations = operations; 33 g_window_initialized = true; 34 } 35 get_emugl_window_operations()36const QAndroidEmulatorWindowAgent &emugl::get_emugl_window_operations() 37 { 38 assert(g_window_initialized); 39 return g_window_operations; 40 } 41 set_emugl_multi_display_operations(const QAndroidMultiDisplayAgent & operations)42void emugl::set_emugl_multi_display_operations(const QAndroidMultiDisplayAgent &operations) { 43 g_multi_display_operations = operations; 44 g_multi_display_initialized = true; 45 } 46 get_emugl_multi_display_operations()47const QAndroidMultiDisplayAgent &emugl::get_emugl_multi_display_operations() { 48 assert(g_multi_display_initialized); 49 return g_multi_display_operations; 50 } 51