blob: 4fe4ed11077f57b73ed6ad726228e585f2d24bdd [file] [log] [blame]
Andy Qiu8a427142013-04-05 17:41:58 -07001/*
2 * Copyright © 2012 Intel Corporation
3 * All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 *
24 * Authors:
25 * Jackie Li <yaodong.li@intel.com>
26 *
27 */
28#ifndef VIRTUAL_DEVICE_H
29#define VIRTUAL_DEVICE_H
30
31
32#include <IDisplayDevice.h>
33
34namespace android {
35namespace intel {
36
37class Hwcomposer;
38class DisplayPlaneManager;
39
40class VirtualDevice : public IDisplayDevice {
41public:
42 VirtualDevice(Hwcomposer& hwc, DisplayPlaneManager& dpm);
43 virtual ~VirtualDevice();
44
45public:
46 virtual bool prePrepare(hwc_display_contents_1_t *display);
47 virtual bool prepare(hwc_display_contents_1_t *display);
48 virtual bool commit(hwc_display_contents_1_t *display,
49 void* context,
50 int& count) = 0;
51
52 virtual bool vsyncControl(int enabled);
53 virtual bool blank(int blank);
54 virtual bool getDisplayConfigs(uint32_t *configs,
55 size_t *numConfigs);
56 virtual bool getDisplayAttributes(uint32_t config,
57 const uint32_t *attributes,
58 int32_t *values);
59 virtual bool compositionComplete();
60 virtual bool initialize();
61 virtual bool isConnected() const;
62 virtual const char* getName() const;
63 virtual int getType() const;
64 virtual void dump(Dump& d);
65
66protected:
67 virtual void deinitialize();
68
69protected:
70 bool mInitialized;
71 Hwcomposer& mHwc;
72 DisplayPlaneManager& mDisplayPlaneManager;
73};
74
75}
76}
77
78#endif /* VIRTUAL_DEVICE_H */