blob: a1bf9ba541b64a07fea9ff4c98d6dfdd7be1060f [file] [log] [blame]
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
Saurabh Shah56f610d2012-08-07 15:27:06 -07003 * Copyright (C) 2012, The Linux Foundation. All rights reserved.
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -07004 *
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
Naseer Ahmed5b6708a2012-08-02 13:46:08 -070033 static bool prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -070034 // Draws layer if this feature is on
35 static bool draw(hwc_context_t *ctx);
Saurabh Shah56f610d2012-08-07 15:27:06 -070036 //Reset values
37 static void reset();
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -070038 private:
39 //Configures overlay
Naseer Ahmed5b6708a2012-08-02 13:46:08 -070040 static bool configure(hwc_context_t *ctx, hwc_display_contents_1_t *list);
Naseer Ahmed0c8b7b52012-07-20 09:06:13 -070041 //The chosen overlay state.
42 static ovutils::eOverlayState sState;
43 //Flags if this feature is on.
44 static bool sIsUiMirroringOn;
45};
46
47}; //namespace qhwc
48
49#endif //HWC_UIMIRROR_H