本文整理汇总了C++中GrContext::makeDeferredRenderTargetContext方法的典型用法代码示例。如果您正苦于以下问题:C++ GrContext::makeDeferredRenderTargetContext方法的具体用法?C++ GrContext::makeDeferredRenderTargetContext怎么用?C++ GrContext::makeDeferredRenderTargetContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrContext
的用法示例。
在下文中一共展示了GrContext::makeDeferredRenderTargetContext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtc
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
sk_sp<GrRenderTargetContext> rtc(ctx->makeDeferredRenderTargetContext(
SkBackingFit::kApprox, 800, 800, kRGBA_8888_GrPixelConfig, nullptr, 1, GrMipMapped::kNo,
kTopLeft_GrSurfaceOrigin));
if (!rtc) {
return;
}
ctx->flush();
// Adding discard to appease vulkan validation warning about loading uninitialized data on draw
rtc->discard();
test_path(ctx, rtc.get(), create_path_0());
test_path(ctx, rtc.get(), create_path_1());
test_path(ctx, rtc.get(), create_path_2());
test_path(ctx, rtc.get(), create_path_3());
test_path(ctx, rtc.get(), create_path_4());
test_path(ctx, rtc.get(), create_path_5());
test_path(ctx, rtc.get(), create_path_6());
test_path(ctx, rtc.get(), create_path_7());
test_path(ctx, rtc.get(), create_path_8());
test_path(ctx, rtc.get(), create_path_9());
test_path(ctx, rtc.get(), create_path_10());
test_path(ctx, rtc.get(), create_path_11());
test_path(ctx, rtc.get(), create_path_12());
test_path(ctx, rtc.get(), create_path_13());
test_path(ctx, rtc.get(), create_path_14());
test_path(ctx, rtc.get(), create_path_15());
test_path(ctx, rtc.get(), create_path_16());
SkMatrix nonInvertibleMatrix = SkMatrix::MakeScale(0, 0);
std::unique_ptr<GrFragmentProcessor> fp(create_linear_gradient_processor(ctx));
test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage,
std::move(fp));
test_path(ctx, rtc.get(), create_path_18());
test_path(ctx, rtc.get(), create_path_19());
test_path(ctx, rtc.get(), create_path_20(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_21(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_22());
test_path(ctx, rtc.get(), create_path_23());
test_path(ctx, rtc.get(), create_path_24());
test_path(ctx, rtc.get(), create_path_25(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_26(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_27(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_28(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_29());
}
示例2: rtc
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
sk_sp<GrRenderTargetContext> rtc(ctx->makeDeferredRenderTargetContext(
SkBackingFit::kApprox,
800, 800,
kRGBA_8888_GrPixelConfig,
nullptr,
0,
kTopLeft_GrSurfaceOrigin));
if (!rtc) {
return;
}
ctx->flush();
test_path(ctx, rtc.get(), create_path_0());
test_path(ctx, rtc.get(), create_path_1());
test_path(ctx, rtc.get(), create_path_2());
test_path(ctx, rtc.get(), create_path_3());
test_path(ctx, rtc.get(), create_path_4());
test_path(ctx, rtc.get(), create_path_5());
test_path(ctx, rtc.get(), create_path_6());
test_path(ctx, rtc.get(), create_path_7());
test_path(ctx, rtc.get(), create_path_8());
test_path(ctx, rtc.get(), create_path_9());
test_path(ctx, rtc.get(), create_path_10());
test_path(ctx, rtc.get(), create_path_11());
test_path(ctx, rtc.get(), create_path_12());
test_path(ctx, rtc.get(), create_path_13());
test_path(ctx, rtc.get(), create_path_14());
test_path(ctx, rtc.get(), create_path_15());
test_path(ctx, rtc.get(), create_path_16());
SkMatrix nonInvertibleMatrix = SkMatrix::MakeScale(0, 0);
sk_sp<GrFragmentProcessor> fp(create_linear_gradient_processor(ctx));
test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp);
test_path(ctx, rtc.get(), create_path_18());
test_path(ctx, rtc.get(), create_path_19());
test_path(ctx, rtc.get(), create_path_20(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_21(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_22());
}
示例3: renderTargetContext
DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
sk_sp<GrRenderTargetContext> renderTargetContext(context->makeDeferredRenderTargetContext(
SkBackingFit::kApprox,
1, 1, kRGBA_8888_GrPixelConfig,
nullptr));
if (!renderTargetContext) {
ERRORF(reporter, "Could not create render target context.");
return;
}
int attribCnt = context->caps()->maxVertexAttributes();
if (!attribCnt) {
ERRORF(reporter, "No attributes allowed?!");
return;
}
context->flush();
context->resetGpuStats();
#if GR_GPU_STATS
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0);
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 0);
#endif
GrPaint grPaint;
// This one should succeed.
renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(attribCnt));
context->flush();
#if GR_GPU_STATS
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 1);
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 0);
#endif
context->resetGpuStats();
renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(attribCnt + 1));
context->flush();
#if GR_GPU_STATS
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0);
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1);
#endif
}