Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame^] | 1 | /* |
| 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 | // --------------------------------------------------------------------------- |
| 24 | namespace android { |
| 25 | // --------------------------------------------------------------------------- |
| 26 | |
| 27 | class HWComposer; |
| 28 | |
| 29 | class VirtualDisplaySurface : public DisplaySurface { |
| 30 | public: |
| 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 | |
| 42 | private: |
| 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 | |