MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / render

Method render

Source/Node/VGNode.cpp:54–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void VGNode::render(const std::function<void()>& func) {
55 AssertIf(_flags.isOn(Node::Cleanup), "can not operate on an invalid VGNode");
56 VGTexture* texture = s_cast<VGTexture*>(_surface->getTexture());
57 NVGLUframebuffer* framebuffer = texture->getFramebuffer();
58 NVGcontext* context = texture->getContext();
59 SharedView.pushFront("VGNode"_slice, [&]() {
60 bgfx::ViewId viewId = SharedView.getId();
61 bgfx::setViewClear(viewId,
62 BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL,
63 0x0);
64 nvgluSetViewFramebuffer(viewId, framebuffer);
65 bgfx::setViewRect(viewId, 0, 0, texture->getWidth(), texture->getHeight());
66 nvgluBindFramebuffer(framebuffer);
67 nvgBeginFrame(context, _frameWidth, _frameHeight, _frameScale);
68 nvg::BindContext(context);
69 switch (bgfx::getCaps()->rendererType) {
70 case bgfx::RendererType::OpenGL:
71 case bgfx::RendererType::OpenGLES:
72 nvgScale(context, 1.0f, -1.0f);
73 nvgTranslate(context, 0.0f, -_frameHeight);
74 break;
75 default:
76 break;
77 }
78 func();
79 nvg::BindContext(nullptr);
80 nvgEndFrame(context);
81 nvgluBindFramebuffer(nullptr);
82 });
83}
84
85NS_DORA_END

Callers

nothing calls this directly

Calls 15

setViewClearFunction · 0.85
nvgluSetViewFramebufferFunction · 0.85
setViewRectFunction · 0.85
nvgluBindFramebufferFunction · 0.85
nvgBeginFrameFunction · 0.85
getCapsFunction · 0.85
nvgScaleFunction · 0.85
nvgTranslateFunction · 0.85
nvgEndFrameFunction · 0.85
isOnMethod · 0.80
getFramebufferMethod · 0.80
getIdMethod · 0.65

Tested by

no test coverage detected