Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame^] | 3 | * Copyright (C) 2012, The Linux Foundation. All rights reserved. |
Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 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 Ahmed | 72cf976 | 2012-07-21 12:17:13 -0700 | [diff] [blame] | 23 | #include "overlay.h" |
Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 24 | |
| 25 | #define LIKELY( exp ) (__builtin_expect( (exp) != 0, true )) |
| 26 | #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) |
| 27 | |
| 28 | namespace qhwc { |
| 29 | //Feature for Mirroring UI on the External display |
| 30 | class UIMirrorOverlay { |
| 31 | public: |
| 32 | // Sets up members and prepares overlay if conditions are met |
Naseer Ahmed | 5b6708a | 2012-08-02 13:46:08 -0700 | [diff] [blame] | 33 | static bool prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list); |
Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 34 | // Draws layer if this feature is on |
| 35 | static bool draw(hwc_context_t *ctx); |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame^] | 36 | //Reset values |
| 37 | static void reset(); |
Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 38 | private: |
| 39 | //Configures overlay |
Naseer Ahmed | 5b6708a | 2012-08-02 13:46:08 -0700 | [diff] [blame] | 40 | static bool configure(hwc_context_t *ctx, hwc_display_contents_1_t *list); |
Naseer Ahmed | 0c8b7b5 | 2012-07-20 09:06:13 -0700 | [diff] [blame] | 41 | //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 |