X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-renderer.h;h=6e1a1f7113ccfb3f4b8c972f502b33ff1f7be35c;hb=649ec06daecb510fb84fe4642a6af957f127e7ab;hp=d7e657512bb61faa208a7837d491ab7f4f9afd0b;hpb=ae36a1ea75ac593961c2b9a06746d13b846d8762;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 d7e6575..6e1a1f7 100644 --- 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) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -26,11 +26,10 @@ #include #include #include -#include #include #include #include -#include +#include #include namespace Dali @@ -46,14 +45,11 @@ namespace SceneGraph { class SceneController; class Shader; -class TextureCache; class NodeDataProvider; } - namespace Render { -class UniformNameCache; /** * Renderers are used to render meshes @@ -69,28 +65,28 @@ public: */ struct StencilParameters { - StencilParameters( StencilMode::Type stencilMode, StencilFunction::Type stencilFunction, int stencilFunctionMask, + StencilParameters( RenderMode::Type renderMode, StencilFunction::Type stencilFunction, int stencilFunctionMask, int stencilFunctionReference, int stencilMask, StencilOperation::Type stencilOperationOnFail, StencilOperation::Type stencilOperationOnZFail, StencilOperation::Type stencilOperationOnZPass ) : stencilFunctionMask ( stencilFunctionMask ), stencilFunctionReference ( stencilFunctionReference ), stencilMask ( stencilMask ), + renderMode ( renderMode ), stencilFunction ( stencilFunction ), stencilOperationOnFail ( stencilOperationOnFail ), stencilOperationOnZFail ( stencilOperationOnZFail ), - stencilOperationOnZPass ( stencilOperationOnZPass ), - stencilMode ( stencilMode ) + stencilOperationOnZPass ( stencilOperationOnZPass ) { } int stencilFunctionMask; ///< The stencil function mask int stencilFunctionReference; ///< The stencil function reference int stencilMask; ///< The stencil mask - StencilFunction::Type stencilFunction:3; ///< The stencil function + RenderMode::Type renderMode:3; ///< The render mode + StencilFunction::Type stencilFunction:3; ///< The stencil function StencilOperation::Type stencilOperationOnFail:3; ///< The stencil operation for stencil test fail StencilOperation::Type stencilOperationOnZFail:3; ///< The stencil operation for depth test fail StencilOperation::Type stencilOperationOnZPass:3; ///< The stencil operation for depth test pass - StencilMode::Type stencilMode:2; ///< The stencil mode }; /** @@ -115,19 +111,17 @@ public: * @param[in] depthTestMode Depth buffer test mode * @param[in] depthFunction Depth function * @param[in] stencilParameters Struct containing all stencil related options - * @param[in] writeToColorBuffer Set to True to write to the color buffer */ static Renderer* New( SceneGraph::RenderDataProvider* dataProviders, Render::Geometry* geometry, unsigned int blendingBitmask, - const Vector4* blendColor, + const Vector4& blendColor, FaceCullingMode::Type faceCullingMode, bool preMultipliedAlphaEnabled, DepthWriteMode::Type depthWriteMode, DepthTestMode::Type depthTestMode, DepthFunction::Type depthFunction, - StencilParameters& stencilParameters, - bool writeToColorBuffer ); + StencilParameters& stencilParameters ); /** * Constructor. @@ -141,39 +135,30 @@ public: * @param[in] depthTestMode Depth buffer test mode * @param[in] depthFunction Depth function * @param[in] stencilParameters Struct containing all stencil related options - * @param[in] writeToColorBuffer Set to True to write to the color buffer */ Renderer( SceneGraph::RenderDataProvider* dataProviders, Render::Geometry* geometry, unsigned int blendingBitmask, - const Vector4* blendColor, + const Vector4& blendColor, FaceCullingMode::Type faceCullingMode, bool preMultipliedAlphaEnabled, DepthWriteMode::Type depthWriteMode, DepthTestMode::Type depthTestMode, DepthFunction::Type depthFunction, - StencilParameters& stencilParameters, - bool writeToColorBuffer ); - - /** - * Change the data providers of the renderer - * @param[in] dataProviders The data providers - */ - void SetRenderDataProvider( SceneGraph::RenderDataProvider* dataProviders ); + StencilParameters& stencilParameters ); /** * Change the geometry used by the renderer * @param[in] geometry The new geometry */ void SetGeometry( Render::Geometry* geometry ); + /** * Second-phase construction. * This is called when the renderer is inside render thread - * @param[in] context to use - * @param[in] textureCache to use - * @param[in] uniformNameCache to use + * @param[in] context Context used by the renderer */ - void Initialize( Context& context, SceneGraph::TextureCache& textureCache, Render::UniformNameCache& uniformNameCache ); + void Initialize( Context& context ); /** * Destructor @@ -196,7 +181,7 @@ public: * Set the blend color for blending options * @param[in] blendColor The blend color to pass to GL */ - void SetBlendColor( const Vector4* color ); + void SetBlendColor( const Vector4& color ); /** * Set the first element index to draw by the indexed draw @@ -254,16 +239,16 @@ public: DepthFunction::Type GetDepthFunction() const; /** - * Sets the stencil mode - * @param[in] stencilMode The stencil function + * Sets the render mode + * @param[in] renderMode The render mode */ - void SetStencilMode( StencilMode::Type stencilMode ); + void SetRenderMode( RenderMode::Type mode ); /** - * Gets the stencil mode - * @return The stencil function + * Gets the render mode + * @return The render mode */ - StencilMode::Type GetStencilMode() const; + RenderMode::Type GetRenderMode() const; /** * Sets the stencil function @@ -350,39 +335,25 @@ public: StencilOperation::Type GetStencilOperationOnZPass() const; /** - * Sets whether or not to write to the color buffer - * @param[in] writeToColorBuffer True to write to the color buffer - */ - void SetWriteToColorBuffer( bool writeToColorBuffer ); - - /** - * Gets whether or not to write to the color buffer - * @return True to write to the color buffer - */ - bool GetWriteToColorBuffer() const; - - /** * Called to render during RenderManager::Render(). * @param[in] context The context used for rendering - * @param[in] textureCache The texture cache used to get textures * @param[in] bufferIndex The index of the previous update buffer. * @param[in] node The node using this renderer - * @param[in] defaultShader in case there is no custom shader * @param[in] modelViewMatrix The model-view matrix. * @param[in] viewMatrix The view matrix. * @param[in] projectionMatrix The projection matrix. + * @param[in] size Size of the render item + * @param[in] blend If true, blending is enabled */ void Render( Context& context, - SceneGraph::TextureCache& textureCache, BufferIndex bufferIndex, const SceneGraph::NodeDataProvider& node, - SceneGraph::Shader& defaultShader, const Matrix& modelMatrix, const Matrix& modelViewMatrix, const Matrix& viewMatrix, const Matrix& projectionMatrix, const Vector3& size, - bool blend); + bool blend ); /** * Write the renderer's sort attributes to the passed in reference @@ -390,7 +361,7 @@ public: * @param[in] bufferIndex The current update buffer index. * @param[out] sortAttributes */ - void SetSortAttributes( BufferIndex bufferIndex, SceneGraph::RendererWithSortAttributes& sortAttributes ) const; + void SetSortAttributes( BufferIndex bufferIndex, SceneGraph::RenderInstructionProcessor::SortAttributes& sortAttributes ) const; private: @@ -429,28 +400,26 @@ private: /** * Bind the textures and setup the samplers * @param[in] context The GL context - * @param[in] textureCache The texture cache * @param[in] program The shader program * @return False if create or bind failed, true if success. */ - bool BindTextures( Context& context, SceneGraph::TextureCache& textureCache, Program& program ); + bool BindTextures( Context& context, Program& program ); private: OwnerPointer< SceneGraph::RenderDataProvider > mRenderDataProvider; Context* mContext; - SceneGraph::TextureCache* mTextureCache; - Render::UniformNameCache* mUniformNameCache; Render::Geometry* mGeometry; struct UniformIndexMap { - unsigned int uniformIndex; ///< The index of the cached location in the Program + unsigned int uniformIndex; ///< The index of the cached location in the Program const PropertyInputImpl* propertyValue; }; typedef Dali::Vector< UniformIndexMap > UniformIndexMappings; + UniformIndexMappings mUniformIndexMap; Vector mAttributesLocation; @@ -462,12 +431,11 @@ private: DepthFunction::Type mDepthFunction:3; ///< The depth function FaceCullingMode::Type mFaceCullingMode:2; ///< The mode of face culling - BlendMode::Type mBlendMode:2; ///< The mode of blending DepthWriteMode::Type mDepthWriteMode:2; ///< The depth write mode DepthTestMode::Type mDepthTestMode:2; ///< The depth test mode - bool mWriteToColorBuffer:1; ///< True if we are writing to the color buffer bool mUpdateAttributesLocation:1; ///< Indicates attribute locations have changed bool mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required + }; } // namespace SceneGraph