MCPcopy Create free account
hub / github.com/Tencent/tgfx / RuntimeDrawTask

Method RuntimeDrawTask

src/gpu/tasks/RuntimeDrawTask.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33namespace tgfx {
34RuntimeDrawTask::RuntimeDrawTask(std::shared_ptr<RenderTargetProxy> target,
35 std::vector<std::shared_ptr<TextureProxy>> inputs,
36 std::shared_ptr<RuntimeEffect> effect, const Point& offset)
37 : renderTargetProxy(std::move(target)), inputTextures(std::move(inputs)),
38 effect(std::move(effect)), offset(offset) {
39 auto context = renderTargetProxy->getContext();
40 inputVertexBuffers.reserve(inputTextures.size());
41 for (auto& input : inputTextures) {
42 if (input != nullptr) {
43 auto maskRect = Rect::MakeWH(input->width(), input->height());
44 auto maskVertexProvider =
45 RectsVertexProvider::MakeFrom(context->drawingBuffer(), maskRect, AAType::None);
46 auto maskBuffer = context->proxyProvider()->createVertexBufferProxy(
47 std::move(maskVertexProvider), RenderFlags::DisableAsyncTask);
48 inputVertexBuffers.push_back(std::move(maskBuffer));
49 } else {
50 inputVertexBuffers.push_back(nullptr);
51 }
52 }
53}
54
55void RuntimeDrawTask::execute(CommandEncoder* encoder) {
56 TASK_MARK(tgfx::inspect::OpTaskType::RuntimeDrawTask);

Callers

nothing calls this directly

Calls 8

getContextMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
drawingBufferMethod · 0.45
proxyProviderMethod · 0.45

Tested by

no test coverage detected