Add support for Graphite unit tests that modify context options.
We now have a GraphiteContextOptionsProc which is functionally
equivalent to GaneshContextOptionsProc, but works with Graphite
unit tests. This will allow certain Graphite unit tests to
force options on. I will use this in a followup CL to force on
WGSL code generation in Dawn for the SkSL unit tests.
Change-Id: Ie20e23f04aad36da5d5582d9f13b2a3467eee447
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/745616
Commit-Queue: Brian Osman <[email protected]>
Auto-Submit: John Stiles <[email protected]>
Reviewed-by: Brian Osman <[email protected]>
diff --git a/dm/DMGpuTestProcs.cpp b/dm/DMGpuTestProcs.cpp
index bf4805b..359d9a8 100644
--- a/dm/DMGpuTestProcs.cpp
+++ b/dm/DMGpuTestProcs.cpp
@@ -92,11 +92,13 @@
namespace graphite {
-void RunWithGraphiteTestContexts(GraphiteTestFn* test, GrContextTypeFilterFn* filter,
- Reporter* reporter) {
- ContextFactory factory;
+void RunWithGraphiteTestContexts(GraphiteTestFn* test,
+ GrContextTypeFilterFn* filter,
+ Reporter* reporter,
+ const skgpu::graphite::ContextOptions& ctxOptions) {
+ ContextFactory factory(ctxOptions);
for (int typeInt = 0; typeInt < GrContextFactory::kContextTypeCnt; ++typeInt) {
- GrContextFactory::ContextType contextType = (GrContextFactory::ContextType) typeInt;
+ GrContextFactory::ContextType contextType = (GrContextFactory::ContextType)typeInt;
if (filter && !(*filter)(contextType)) {
continue;
}