26ContextFactory::OwnedContextInfo::OwnedContextInfo() =
default;
28ContextFactory::OwnedContextInfo::OwnedContextInfo(
30 std::unique_ptr<GraphiteTestContext> testContext,
31 std::unique_ptr<skgpu::graphite::Context> context)
34ContextFactory::OwnedContextInfo::~OwnedContextInfo() {
38 fTestContext->syncedSubmit(
fContext.get());
43ContextFactory::OwnedContextInfo::OwnedContextInfo(OwnedContextInfo&&) =
default;
44ContextFactory::OwnedContextInfo& ContextFactory::OwnedContextInfo::operator=(OwnedContextInfo&&) =
50ContextInfo ContextFactory::AsContextInfo(
const OwnedContextInfo& owned) {
60 for (
const OwnedContextInfo& ctxInfo : fContexts) {
61 if (ctxInfo.fType ==
type) {
62 return AsContextInfo(ctxInfo);
67 std::unique_ptr<GraphiteTestContext> testCtx;
83 case skgpu::ContextType::kDawn_##TYPE: \
84 testCtx = graphite::DawnTestContext::Make(wgpu::BackendType::TYPE); \
88 case skgpu::ContextType::kDawn_##TYPE: \
107 std::unique_ptr<skgpu::graphite::Context> context = testCtx->makeContext(fOptions);
112 fContexts.push_back({
type, std::move(testCtx), std::move(context)});
113 return AsContextInfo(fContexts.back());
ContextInfo getContextInfo(skgpu::ContextType)
static std::unique_ptr< GraphiteTestContext > Make()
static std::unique_ptr< GraphiteTestContext > Make()
bool IsDawnBackend(skgpu::ContextType type)
@ kVulkan
ANGLE on Metal ES 3 context.
GraphiteTestContext * fTestContext