skia2/tests/graphite/CombinationBuilderTestAccess.h
Robert Phillips 47a67a7f4f [graphite] Use CombinationBuilder to create SkPaintParamsKeys directly
Bug: skia:12701
Change-Id: I53bbabb2aba44e3bfc215df81dae1ae59d149263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544319
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-06-16 17:16:30 +00:00

42 lines
1.2 KiB
C++

/*
* Copyright 2022 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef CombinationBuilderTestAccess_DEFINED
#define CombinationBuilderTestAccess_DEFINED
#include "include/core/SkCombinationBuilder.h"
#include "include/private/SkUniquePaintParamsID.h"
class CombinationBuilderTestAccess {
public:
static int NumCombinations(SkCombinationBuilder* builder) {
return builder->numCombinations();
}
static std::vector<SkUniquePaintParamsID> BuildCombinations(SkShaderCodeDictionary* dict,
SkCombinationBuilder* builder) {
std::vector<SkUniquePaintParamsID> uniqueIDs;
builder->buildCombinations(dict,
[&](SkUniquePaintParamsID uniqueID) {
uniqueIDs.push_back(uniqueID);
});
return uniqueIDs;
}
#ifdef SK_DEBUG
static int Epoch(const SkCombinationBuilder& builder) {
return builder.epoch();
}
static int Epoch(const SkCombinationOption& option) {
return option.epoch();
}
#endif
};
#endif // CombinationBuilderTestAccess_DEFINED