2 * Copyright (C) 2015 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef ANDROID_VIRTUAL_COMPOSITOR_WORKER_H_
18 #define ANDROID_VIRTUAL_COMPOSITOR_WORKER_H_
20 #include "drm_hwcomposer.h"
27 class VirtualCompositorWorker : public Worker {
29 VirtualCompositorWorker();
30 ~VirtualCompositorWorker() override;
33 void QueueComposite(hwc_display_contents_1_t *dc);
36 void Routine() override;
39 struct VirtualComposition {
40 UniqueFd outbuf_acquire_fence;
41 std::vector<UniqueFd> layer_acquire_fences;
45 int CreateNextTimelineFence();
46 int FinishComposition(int timeline);
47 void Compose(std::unique_ptr<VirtualComposition> composition);
49 std::queue<std::unique_ptr<VirtualComposition>> composite_queue_;
52 int timeline_current_;