blob: c6d4c626ba3a94e310ec61dff42f25635bcb2777
1 | /* |
2 | * Copyright (c) 2017 Amlogic, Inc. All rights reserved. |
3 | * |
4 | * This source code is subject to the terms and conditions defined in the |
5 | * file 'LICENSE' which is part of this source code package. |
6 | * |
7 | * Description: |
8 | */ |
9 | |
10 | #include "HwcModeMgr.h" |
11 | #include "FixedSizeModeMgr.h" |
12 | #include "VariableModeMgr.h" |
13 | #include "ActiveModeMgr.h" |
14 | #include "RealModeMgr.h" |
15 | |
16 | std::shared_ptr<HwcModeMgr> createModeMgr( |
17 | hwc_modes_policy_t policy) { |
18 | if (policy == FIXED_SIZE_POLICY) { |
19 | HwcModeMgr * modeMgr = (HwcModeMgr *) new FixedSizeModeMgr(); |
20 | return std::shared_ptr<HwcModeMgr>(std::move(modeMgr)); |
21 | } else if (policy == FULL_ACTIVE_POLICY) { |
22 | HwcModeMgr * modeMgr = (HwcModeMgr *) new VariableModeMgr(); |
23 | return std::shared_ptr<HwcModeMgr>(std::move(modeMgr)); |
24 | } else if (policy == ACTIVE_MODE_POLICY) { |
25 | HwcModeMgr * modeMgr = (HwcModeMgr *) new ActiveModeMgr(); |
26 | return std::shared_ptr<HwcModeMgr>(std::move(modeMgr)); |
27 | } else if (policy == REAL_MODE_POLICY){ |
28 | HwcModeMgr * modeMgr = (HwcModeMgr *) new RealModeMgr(); |
29 | return std::shared_ptr<HwcModeMgr>(std::move(modeMgr)); |
30 | } else { |
31 | return NULL; |
32 | } |
33 | } |
34 | |
35 |