201 {
202 auto dContext = ctxInfo.directContext();
204
205 static constexpr SkISize kDims = {10, 10};
206
212
213 for (bool makeClone : {false, true}) {
214 for (int parentCnt = 0; parentCnt < 2; parentCnt++) {
217 nullptr,
219 {1, 1},
221 {});
222 {
225 kDims,
227 1,
232 "ProcessorRefTest");
233
234 {
238 for (
int i = 0;
i < parentCnt; ++
i) {
240 }
241 std::unique_ptr<GrFragmentProcessor> clone;
242 if (makeClone) {
244 }
246 sdc->addDrawOp(std::move(op));
247 if (clone) {
249 sdc->addDrawOp(std::move(op));
250 }
251 }
252
253
254 int expectedProxyRefs = makeClone ? 3 : 2;
255
257
258 dContext->flushAndSubmit();
259
260
262 }
263 }
264 }
265}
@ kTopLeft_GrSurfaceOrigin
void CheckSingleThreadedProxyRefs(skiatest::Reporter *reporter, GrSurfaceProxy *proxy, int32_t expectedProxyRefs, int32_t expectedBackingRefs)
std::unique_ptr< GrOp > Owner
sk_sp< GrTextureProxy > createProxy(const GrBackendFormat &, SkISize dimensions, GrRenderable, int renderTargetSampleCnt, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, GrProtected, std::string_view label, GrInternalSurfaceFlags=GrInternalSurfaceFlags::kNone, UseAllocator useAllocator=UseAllocator::kYes)
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
uint32_t uint32_t * format
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)