X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fgraphics-api%2Fgraphics-command-buffer.h;h=61dd8dfe5843a0224d4a90ae70bceb8accb4406d;hb=9d8818db1ee5ad9497cb7698be2a4752f6ecf50e;hp=2ac5417c378bcced7af40fce39450b00ec426df5;hpb=3aa909145b7d672d0b966d3595b138ed1537b091;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/graphics-api/graphics-command-buffer.h b/dali/graphics-api/graphics-command-buffer.h index 2ac5417..61dd8df 100644 --- a/dali/graphics-api/graphics-command-buffer.h +++ b/dali/graphics-api/graphics-command-buffer.h @@ -2,7 +2,7 @@ #define DALI_GRAPHICS_COMMAND_BUFFER_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,6 +88,22 @@ struct ClearValue }; }; +// Native rendering (using native APIs) + +enum class DrawNativeAPI +{ + GLES, + UNDEFINED +}; + +struct DrawNativeInfo +{ + DrawNativeAPI api; //< API used by the callback + Dali::CallbackBase* callback; //< Callback pointer + void* userData; //< Data passed into the callback (unspecified type, callback should decode it) + void* reserved; //< Reserved for internal use +}; + /** * @brief CommandBuffer contains a stream of commands to be executed * by the controller. @@ -111,9 +127,9 @@ public: * @param[in] buffers List of buffers to bind * @param[in] offsets List of offsets for each buffer */ - virtual void BindVertexBuffers(uint32_t firstBinding, - std::vector buffers, - std::vector offsets) = 0; + virtual void BindVertexBuffers(uint32_t firstBinding, + const std::vector& buffers, + const std::vector& offsets) = 0; /** * @brief Binds uniform buffers @@ -134,14 +150,14 @@ public: * * @param[in] textureBindings List of texture bindings */ - virtual void BindTextures(std::vector& textureBindings) = 0; + virtual void BindTextures(const std::vector& textureBindings) = 0; /** * @brief Binds samplers * * @param[in] samplerBindings List of sampler bindings */ - virtual void BindSamplers(std::vector& samplerBindings) = 0; + virtual void BindSamplers(const std::vector& samplerBindings) = 0; /** * @brief Binds buffer containing push constants @@ -183,10 +199,10 @@ public: * @param[in] clearValues clear values (compatible with renderpass spec) */ virtual void BeginRenderPass( - RenderPass* renderPass, - RenderTarget* renderTarget, - Rect2D renderArea, - std::vector clearValues) = 0; + RenderPass* renderPass, + RenderTarget* renderTarget, + Rect2D renderArea, + const std::vector& clearValues) = 0; /** * @brief Ends current render pass @@ -266,6 +282,21 @@ public: uint32_t stride) = 0; /** + * @brief Draws using native API (via callback) + * + * DrawNative should be use in order to acquire direct access to the + * graphics API like GL. Upon command execution, the backend will + * invoke given callback and pass API-specific arguments (for example, + * the GL callback will receive EGL context used for rendering). + * + * The client side must make sure the callback is valid for the + * time of execution. + * + * @param[in] drawInfo NativeDrawInfo structure + */ + virtual void DrawNative(const DrawNativeInfo* drawInfo) = 0; + + /** * @brief Resets CommandBuffer * * This function resets the command buffer and discards all previously