Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: tools/vulkan/android/VulkanTestContext_android.cpp

Issue 1903253003: VulkanViewer on Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/vulkan/android/VulkanTestContext_android.h ('k') | tools/vulkan/android/Window_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2015 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #include "VulkanTestContext_android.h"
10
11 #include "vk/GrVkInterface.h"
12 #include "../../src/gpu/vk/GrVkUtil.h"
13
14 VkSurfaceKHR VulkanTestContext::createVkSurface(void* platformData) {
15 // need better error handling here
16 SkASSERT(platformData);
17 ContextPlatformData_android* androidPlatformData =
18 reinterpret_cast<ContextPlatformData_ android*>(platformData);
19 VkSurfaceKHR surface;
20
21 VkAndroidSurfaceCreateInfoKHR surfaceCreateInfo;
22 memset(&surfaceCreateInfo, 0, sizeof(VkAndroidSurfaceCreateInfoKHR));
23 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
24 surfaceCreateInfo.pNext = nullptr;
25 surfaceCreateInfo.flags = 0;
26 surfaceCreateInfo.window = androidPlatformData->fNativeWindow;
27
28 VkResult res = GR_VK_CALL(fBackendContext->fInterface,
29 CreateAndroidSurfaceKHR(fBackendContext->fInstance ,
30 &surfaceCreateInfo,
31 nullptr, &surface));
32 return (VK_SUCCESS == res) ? surface : VK_NULL_HANDLE;
33 }
34
35 bool VulkanTestContext::canPresent(uint32_t queueFamilyIndex) {
36 return true;
37 }
OLDNEW
« no previous file with comments | « tools/vulkan/android/VulkanTestContext_android.h ('k') | tools/vulkan/android/Window_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698