• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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_HWUI_DRAW_VK_INFO_H
18 #define ANDROID_HWUI_DRAW_VK_INFO_H
19 
20 #include <SkColorSpace.h>
21 #include <vulkan/vulkan.h>
22 
23 namespace android {
24 namespace uirenderer {
25 
26 struct VkFunctorInitParams {
27   VkInstance instance;
28   VkPhysicalDevice physical_device;
29   VkDevice device;
30   VkQueue queue;
31   uint32_t graphics_queue_index;
32   uint32_t api_version;
33   const char* const* enabled_instance_extension_names;
34   uint32_t enabled_instance_extension_names_length;
35   const char* const* enabled_device_extension_names;
36   uint32_t enabled_device_extension_names_length;
37   const VkPhysicalDeviceFeatures2* device_features_2;
38 };
39 
40 struct VkFunctorDrawParams {
41   // Input: current width/height of destination surface.
42   int width;
43   int height;
44 
45   // Input: current transform matrix
46   float transform[16];
47 
48   // Input WebView should do its main compositing draws into this. It cannot do
49   // anything that would require stopping the render pass.
50   VkCommandBuffer secondary_command_buffer;
51 
52   // Input: The main color attachment index where secondary_command_buffer will
53   // eventually be submitted.
54   uint32_t color_attachment_index;
55 
56   // Input: A render pass which will be compatible to the one which the
57   // secondary_command_buffer will be submitted into.
58   VkRenderPass compatible_render_pass;
59 
60   // Input: Format of the destination surface.
61   VkFormat format;
62 
63   // Input: Color space.
64   const SkColorSpace* color_space_ptr;
65 
66   // Input: current clip rect
67   int clip_left;
68   int clip_top;
69   int clip_right;
70   int clip_bottom;
71 };
72 
73 }  // namespace uirenderer
74 }  // namespace android
75 
76 #endif  // ANDROID_HWUI_DRAW_VK_INFO_H
77