+ // Check if there is render callback
+ if(mRenderCallback)
+ {
+ if(!mRenderCallbackInput)
+ {
+ mRenderCallbackInput = std::unique_ptr<RenderCallbackInput>(new RenderCallbackInput);
+ }
+
+ Graphics::DrawNativeInfo info{};
+ info.api = Graphics::DrawNativeAPI::GLES;
+ info.callback = &static_cast<Dali::CallbackBase&>(*mRenderCallback);
+ info.userData = mRenderCallbackInput.get();
+
+ // Set storage for the context to be used
+ info.glesNativeInfo.eglSharedContextStoragePointer = &mRenderCallbackInput->eglContext;
+ info.reserved = nullptr;
+
+ auto& textureResources = mRenderCallback->GetTextureResources();
+
+ if(!textureResources.empty())
+ {
+ mRenderCallbackTextureBindings.clear();
+ mRenderCallbackInput->textureBindings.resize(textureResources.size());
+ auto i = 0u;
+ for(auto& texture : textureResources)
+ {
+ auto& textureImpl = GetImplementation(texture);
+ auto graphicsTexture = textureImpl.GetRenderTextureKey()->GetGraphicsObject();
+
+ auto properties = mGraphicsController->GetTextureProperties(*graphicsTexture);
+
+ mRenderCallbackTextureBindings.emplace_back(graphicsTexture);
+ mRenderCallbackInput->textureBindings[i++] = properties.nativeHandle;
+ }
+ info.textureCount = mRenderCallbackTextureBindings.size();
+ info.textureList = mRenderCallbackTextureBindings.data();
+ }
+
+ // pass render callback input
+ mRenderCallbackInput->size = size;
+ mRenderCallbackInput->projection = projectionMatrix;
+
+ MatrixUtils::MultiplyProjectionMatrix(mRenderCallbackInput->mvp, modelViewMatrix, projectionMatrix);
+
+ // submit draw
+ commandBuffer.DrawNative(&info);
+ return true;
+ }
+