54 {
56 return {};
57 }
58
59
60 for (const OwnedContextInfo& ctxInfo : fContexts) {
61 if (ctxInfo.fType ==
type) {
62 return AsContextInfo(ctxInfo);
63 }
64 }
65
66
67 std::unique_ptr<GraphiteTestContext> testCtx;
68
71#ifdef SK_METAL
73#endif
74 } break;
76#ifdef SK_VULKAN
78#endif
79 } break;
80#ifdef SK_DAWN
81
82#define CASE(TYPE) \
83 case skgpu::ContextType::kDawn_##TYPE: \
84 testCtx = graphite::DawnTestContext::Make(wgpu::BackendType::TYPE); \
85 break;
86#else
87#define CASE(TYPE) \
88 case skgpu::ContextType::kDawn_##TYPE: \
89 break;
90#endif
97#undef CASE
98
99 default:
100 break;
101 }
102
103 if (!testCtx) {
104 return ContextInfo{};
105 }
106
107 std::unique_ptr<skgpu::graphite::Context> context = testCtx->makeContext(fOptions);
108 if (!context) {
109 return ContextInfo{};
110 }
111
112 fContexts.push_back({
type, std::move(testCtx), std::move(context)});
113 return AsContextInfo(fContexts.back());
114}
static std::unique_ptr< GraphiteTestContext > Make()
static std::unique_ptr< GraphiteTestContext > Make()
bool IsDawnBackend(skgpu::ContextType type)
@ kVulkan
ANGLE on Metal ES 3 context.