X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-renderer.h;h=5f4bbfb373898fb75ab4bff49a78fb8947fc709d;hb=746395d3f460dfc61a724c59fb0fe90d8f5e637f;hp=1f8d99e1041888159b1d50a32ff620ac8b93fcd0;hpb=ba99c2fc92c63f4a7a513813dfc5e76cc502b831;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/renderers/render-renderer.h b/dali/internal/render/renderers/render-renderer.h index 1f8d99e..5f4bbfb 100755 --- a/dali/internal/render/renderers/render-renderer.h +++ b/dali/internal/render/renderers/render-renderer.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_RENDER_RENDERER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -46,6 +46,8 @@ namespace SceneGraph class SceneController; class Shader; class NodeDataProvider; + +class RenderInstruction; //for relfection effect } namespace Render @@ -153,6 +155,17 @@ public: */ void SetGeometry( Render::Geometry* geometry ); + void SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size ); + + /** + * @brief Returns a reference to an array of draw commands + * @return Valid array of draw commands (may be empty) + */ + const std::vector& GetDrawCommands() const + { + return mDrawCommands; + } + /** * Second-phase construction. * This is called when the renderer is inside render thread @@ -335,6 +348,12 @@ public: StencilOperation::Type GetStencilOperationOnZPass() const; /** + * Called to upload during RenderManager::Render(). + * @param[in] context The context used for uploading + */ + void Upload( Context& context ); + + /** * Called to render during RenderManager::Render(). * @param[in] context The context used for rendering * @param[in] bufferIndex The index of the previous update buffer. @@ -344,6 +363,9 @@ public: * @param[in] projectionMatrix The projection matrix. * @param[in] size Size of the render item * @param[in] blend If true, blending is enabled + * @param[in] boundTextures The textures bound for rendering + * @param[in] instruction. for use case like reflection where CullFace needs to be adjusted + */ void Render( Context& context, BufferIndex bufferIndex, @@ -353,7 +375,10 @@ public: const Matrix& viewMatrix, const Matrix& projectionMatrix, const Vector3& size, - bool blend ); + bool blend, + Vector& boundTextures, + const Dali::Internal::SceneGraph::RenderInstruction& instruction, + uint32_t queueIndex ); /** * Write the renderer's sort attributes to the passed in reference @@ -363,6 +388,21 @@ public: */ void SetSortAttributes( BufferIndex bufferIndex, SceneGraph::RenderInstructionProcessor::SortAttributes& sortAttributes ) const; + /** + * Sets the flag indicating whether shader changed. + * + * @param[in] value True if shader changed + */ + void SetShaderChanged( bool value ); + + /** + * Check if the renderer attributes/uniforms are updated and returns the flag + * + * @param[in] bufferIndex The current update buffer index. + * @param[in] node The node using this renderer + */ + bool Updated(BufferIndex bufferIndex, const SceneGraph::NodeDataProvider* node); + private: struct UniformIndexMap; @@ -401,9 +441,10 @@ private: * Bind the textures and setup the samplers * @param[in] context The GL context * @param[in] program The shader program + * @param[in] boundTextures The textures bound for rendering * @return False if create or bind failed, true if success. */ - bool BindTextures( Context& context, Program& program ); + bool BindTextures( Context& context, Program& program, Vector& boundTextures ); private: @@ -423,6 +464,8 @@ private: UniformIndexMappings mUniformIndexMap; Vector mAttributesLocation; + uint64_t mUniformsHash; + StencilParameters mStencilParameters; ///< Struct containing all stencil related options BlendingOptions mBlendingOptions; ///< Blending options including blend color, blend func and blend equation @@ -435,7 +478,11 @@ private: DepthTestMode::Type mDepthTestMode:3; ///< The depth test mode bool mUpdateAttributesLocation:1; ///< Indicates attribute locations have changed bool mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required + bool mShaderChanged:1; ///< Flag indicating the shader changed and uniform maps have to be updated + bool mUpdated:1; + + std::vector mDrawCommands; // Devel stuff }; } // namespace SceneGraph