xref: /aosp_15_r20/external/skia/tools/graphite/TestOptions.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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  */
7 
8 #ifndef skiatest_graphite_TestOptions_DEFINED
9 #define skiatest_graphite_TestOptions_DEFINED
10 
11 #include "include/gpu/graphite/ContextOptions.h"
12 
13 namespace skiatest::graphite {
14 
15 struct TestOptions {
16     TestOptions() = default;
17     TestOptions(const TestOptions&) = default;
18     TestOptions(TestOptions&&) = default;
19     TestOptions& operator=(const TestOptions&) = default;
20     TestOptions& operator=(TestOptions&&) = default;
21 
hasDawnOptionsTestOptions22     bool hasDawnOptions() const {
23 #if defined(SK_DAWN)
24         return fDisableTintSymbolRenaming ||
25                fNeverYieldToWebGPU ||
26                fUseTintIR ||
27                fUseWGPUTextureView;
28 #else
29         return false;
30 #endif
31     }
32 
33     skgpu::graphite::ContextOptions fContextOptions = {};
34 
35 #if defined(SK_DAWN)
36     bool fDisableTintSymbolRenaming = false;
37     bool fNeverYieldToWebGPU = false;
38     bool fUseTintIR = false;
39     bool fUseWGPUTextureView = false;
40 #endif
41 };
42 
43 }  // namespace skiatest::graphite
44 
45 #endif
46