• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 #pragma once
17 
18 #include <future>
19 
20 #include "DisplaySurfaceUser.h"
21 #include "PostWorker.h"
22 
23 namespace gfxstream {
24 
25 namespace vk {
26 class DisplayVk;
27 }  // namespace vk
28 
29 class PostWorkerVk : public PostWorker {
30    public:
31     PostWorkerVk(FrameBuffer* fb, Compositor* compositor, vk::DisplayVk* displayGl);
32 
33     void screenshot(ColorBuffer* cb, int screenwidth, int screenheight, GLenum format, GLenum type,
34                     int skinRotation, void* pixels, Rect rect) override;
35 
36    protected:
37     std::shared_future<void> postImpl(ColorBuffer* cb) override;
38     void viewportImpl(int width, int height) override;
39     void clearImpl() override;
40     void exitImpl() override;
41 
42    private:
43     // TODO(b/233939967): conslidate DisplayGl and DisplayVk into
44     // `Display* const m_display`.
45     //
46     // The implementation for Vulkan native swapchain. Only initialized when
47     // useVulkan is set when calling FrameBuffer::initialize(). PostWorker
48     // doesn't take the ownership of this DisplayVk object.
49     vk::DisplayVk* const m_displayVk;
50 };
51 
52 }  // namespace gfxstream