Flutter Engine
The Flutter Engine
GrVkContextThreadSafeProxy.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8
11#include "include/gpu/GrTypes.h"
13
14class GrCaps;
15struct GrContextOptions;
16
19
22 bool isTextureable,
23 skgpu::Mipmapped isMipmapped,
24 skgpu::Protected isProtected,
25 bool vkRTSupportsInputAttachment,
26 bool forVulkanSecondaryCommandBuffer) {
27 if (forVulkanSecondaryCommandBuffer &&
28 (isTextureable || isMipmapped == skgpu::Mipmapped::kYes || vkRTSupportsInputAttachment)) {
29 return false;
30 }
31
32 const GrVkCaps* vkCaps = (const GrVkCaps*)caps.get();
33
34 // The protection status of the characterization and the context need to match
35 return isProtected == GrProtected(vkCaps->supportsProtectedContent());
36}
skgpu::Protected GrProtected
Definition: GrTypes.h:139
GrBackendApi
Definition: GrTypes.h:95
Definition: GrCaps.h:57
bool supportsProtectedContent() const
Definition: GrCaps.h:422
bool isValidCharacterizationForVulkan(sk_sp< const GrCaps >, bool isTextureable, skgpu::Mipmapped isMipmapped, skgpu::Protected isProtected, bool vkRTSupportsInputAttachment, bool forVulkanSecondaryCommandBuffer) override
GrVkContextThreadSafeProxy(const GrContextOptions &)
T * get() const
Definition: SkRefCnt.h:303
@ kVulkan
Definition: embedder.h:86
Mipmapped
Definition: GpuTypes.h:53
Protected
Definition: GpuTypes.h:61