blob: db886ed0e1f9b6219a790993250a5e631e18a9c9 [file] [log] [blame]
Jesse Hall99c7dbb2013-03-14 14:29:29 -07001/*
2 * Copyright 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_SF_VIRTUAL_DISPLAY_SURFACE_H
18#define ANDROID_SF_VIRTUAL_DISPLAY_SURFACE_H
19
20#include <utils/String8.h>
21#include "DisplaySurface.h"
22
23// ---------------------------------------------------------------------------
24namespace android {
25// ---------------------------------------------------------------------------
26
27class HWComposer;
28
29class VirtualDisplaySurface : public DisplaySurface {
30public:
31 VirtualDisplaySurface(HWComposer& hwc, int disp,
32 const sp<IGraphicBufferProducer>& sink,
33 const String8& name);
34
35 virtual sp<IGraphicBufferProducer> getIGraphicBufferProducer() const;
36
37 virtual status_t compositionComplete();
38 virtual status_t advanceFrame();
39 virtual status_t setReleaseFenceFd(int fenceFd);
40 virtual void dump(String8& result) const;
41
42private:
43 virtual ~VirtualDisplaySurface();
44
45 // immutable after construction
46 HWComposer& mHwc;
47 int mDisplayId;
48 sp<IGraphicBufferProducer> mSink;
49 String8 mName;
50};
51
52// ---------------------------------------------------------------------------
53} // namespace android
54// ---------------------------------------------------------------------------
55
56#endif // ANDROID_SF_VIRTUAL_DISPLAY_SURFACE_H
57