1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2021 Google LLC
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci#ifndef skiatest_graphite_GraphiteTestContext_DEFINED
9cb93a386Sopenharmony_ci#define skiatest_graphite_GraphiteTestContext_DEFINED
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_ci#include "experimental/graphite/include/GraphiteTypes.h"
12cb93a386Sopenharmony_ci#include "include/core/SkRefCnt.h"
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_cinamespace skgpu { class Context; }
15cb93a386Sopenharmony_ci
16cb93a386Sopenharmony_cinamespace skiatest::graphite {
17cb93a386Sopenharmony_ci
18cb93a386Sopenharmony_ci/**
19cb93a386Sopenharmony_ci * An offscreen 3D context. This class is intended for Skia's internal testing needs and not
20cb93a386Sopenharmony_ci * for general use.
21cb93a386Sopenharmony_ci */
22cb93a386Sopenharmony_ciclass GraphiteTestContext {
23cb93a386Sopenharmony_cipublic:
24cb93a386Sopenharmony_ci    GraphiteTestContext(const GraphiteTestContext&) = delete;
25cb93a386Sopenharmony_ci    GraphiteTestContext& operator=(const GraphiteTestContext&) = delete;
26cb93a386Sopenharmony_ci
27cb93a386Sopenharmony_ci    virtual ~GraphiteTestContext();
28cb93a386Sopenharmony_ci
29cb93a386Sopenharmony_ci    virtual skgpu::BackendApi backend() = 0;
30cb93a386Sopenharmony_ci
31cb93a386Sopenharmony_ci    virtual sk_sp<skgpu::Context> makeContext() = 0;
32cb93a386Sopenharmony_ci
33cb93a386Sopenharmony_ciprotected:
34cb93a386Sopenharmony_ci    GraphiteTestContext();
35cb93a386Sopenharmony_ci};
36cb93a386Sopenharmony_ci
37cb93a386Sopenharmony_ci
38cb93a386Sopenharmony_ci}  // namespace skiatest::graphite
39cb93a386Sopenharmony_ci
40cb93a386Sopenharmony_ci#endif // skiatest_graphite_GraphiteTestContext_DEFINED
41