1#pragma once 2/* 3 * Copyright (C) 2016 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18#include <guest/libs/platform_support/api_level_fixes.h> 19 20#include <hardware/hwcomposer.h> 21#include <hardware/hwcomposer_defs.h> 22 23#if VSOC_PLATFORM_SDK_BEFORE(J_MR1) 24typedef hwc_composer_device_t vsoc_hwc_device; 25typedef hwc_layer_t vsoc_hwc_layer; 26#define IS_TARGET_FRAMEBUFFER(x) false 27#define IS_PRIMARY_DISPLAY(x) true 28#define VSOC_HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_3 29#else 30typedef hwc_composer_device_1_t vsoc_hwc_device; 31typedef hwc_layer_1_t vsoc_hwc_layer; 32#define IS_TARGET_FRAMEBUFFER(x) ((x) == HWC_FRAMEBUFFER_TARGET) 33#define IS_PRIMARY_DISPLAY(x) ((x) == HWC_DISPLAY_PRIMARY) 34#define VSOC_HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_1_1 35#endif 36