-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraphite_native_vulkan.cpp
More file actions
36 lines (32 loc) · 1.23 KB
/
Copy pathgraphite_native_vulkan.cpp
File metadata and controls
36 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "include/core/SkAlphaType.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSurface.h"
#include "include/gpu/graphite/Context.h"
#include "include/gpu/graphite/Recorder.h"
#include "include/gpu/graphite/ContextOptions.h"
#include "include/gpu/vk/VulkanBackendContext.h"
#include "include/gpu/graphite/Surface.h"
#include "include/gpu/vk/VulkanExtensions.h"
#include "include/gpu/graphite/vk/VulkanGraphiteContext.h"
#define WIDTH 200
#define HEIGHT 400
int main(int argc, char** argv) {
skgpu::VulkanBackendContext backendContext;
std::unique_ptr<skgpu::VulkanExtensions> extensions(new skgpu::VulkanExtensions());
backendContext.fInstance = VK_NULL_HANDLE;
backendContext.fDevice = VK_NULL_HANDLE;
skgpu::graphite::ContextOptions options;
std::unique_ptr<skgpu::graphite::Context> context =
skgpu::graphite::ContextFactory::MakeVulkan(backendContext, options);
if (!context) {
printf("Could not make Graphite Native Vulkan context\n");
return 1;
}
// ... create surfaces and draw
return 0;
}