blob: 98f78963f68fa1bb6287cdb93952cc39226d5749 [file] [log] [blame]
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 * Copyright (C) 2012, Code Aurora Forum. All rights reserved.
4 *
5 * Not a Contribution, Apache license notifications and license are
6 * retained for attribution purposes only.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20#ifndef HWC_UIMIRROR_H
21#define HWC_UIMIRROR_H
22#include "hwc_utils.h"
Naseer Ahmed72cf9762012-07-21 12:17:13 -070023#include "overlay.h"
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -070024
25#define LIKELY( exp ) (__builtin_expect( (exp) != 0, true ))
26#define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false ))
27
28namespace qhwc {
29//Feature for Mirroring UI on the External display
30class UIMirrorOverlay {
31 public:
32 // Sets up members and prepares overlay if conditions are met
33 static bool prepare(hwc_context_t *ctx, hwc_layer_list_t *list);
34 // Draws layer if this feature is on
35 static bool draw(hwc_context_t *ctx);
36 private:
37 //Configures overlay
38 static bool configure(hwc_context_t *ctx, hwc_layer_list_t *list);
39 //The chosen overlay state.
40 static ovutils::eOverlayState sState;
41 //Flags if this feature is on.
42 static bool sIsUiMirroringOn;
43};
44
45}; //namespace qhwc
46
47#endif //HWC_UIMIRROR_H