X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Frender-instruction-processor.h;h=abaa466d207598212d9ca95d775c4eeef2ac2339;hb=db19f62c335177ef99817f74481df996d2044b98;hp=3e2b524bfaf50e8183c356d49c15710b3138be5f;hpb=09a4ac29b536cd57fc8c25ae586021acfce69c08;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/manager/render-instruction-processor.h b/dali/internal/update/manager/render-instruction-processor.h index 3e2b524..abaa466 100644 --- a/dali/internal/update/manager/render-instruction-processor.h +++ b/dali/internal/update/manager/render-instruction-processor.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_PROCESSOR_H /* - * Copyright (c) 2016 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. @@ -21,15 +21,12 @@ // INTERNAL INCLUDES #include #include -#include #include namespace Dali { - namespace Internal { - namespace Render { class Geometry; @@ -37,7 +34,6 @@ class Geometry; namespace SceneGraph { - class RenderTracker; struct RenderItem; class Shader; @@ -45,14 +41,12 @@ struct RenderList; class RenderTask; class RenderInstructionContainer; - /** * @brief This class handles the sorting and preparation of Renderers for each layer. */ class RenderInstructionProcessor { public: - /** * @brief Constructor. */ @@ -70,28 +64,27 @@ public: struct SortAttributes { SortAttributes() - : renderItem( NULL ), - shader( NULL ), - textureSet( NULL ), - geometry( NULL ), - zValue( 0.0f ) + : renderItem(nullptr), + shader(nullptr), + textureSet(nullptr), + geometry(nullptr), + zValue(0.0f) { } - RenderItem* renderItem; ///< The render item that is being sorted (includes depth index) - const Shader* shader; ///< The shader instance - const void* textureSet; ///< The textureSet instance - const Render::Geometry* geometry; ///< The geometry instance - float zValue; ///< The Z value of the given renderer (either distance from camera, or a custom calculated value) + RenderItem* renderItem; ///< The render item that is being sorted (includes depth index) + const Shader* shader; ///< The shader instance + const void* textureSet; ///< The textureSet instance + const Render::Geometry* geometry; ///< The geometry instance + float zValue; ///< The Z value of the given renderer (either distance from camera, or a custom calculated value) }; - /** * @brief Sorts and prepares the list of opaque/transparent Renderers for each layer. * Whilst iterating through each layer, update the RenderItems ModelView matrices * * The opaque and transparent render lists are sorted first by depth - * index, then by Z (for transparent only), then by shader, texture + * index, then by Z (for transparent only), then by shader * and geometry. The render algorithm should then work through both * lists simultaneously, working through opaque then transparent * items at each depth index, resetting the flags appropriately. @@ -103,42 +96,40 @@ public: * @param[in] hasClippingNodes Whether any clipping nodes exist within this layer, to optimize sorting if not * @param[out] instructions The rendering instructions for the next frame. */ - void Prepare( BufferIndex updateBufferIndex, - SortedLayerPointers& sortedLayers, - RenderTask& renderTask, - bool cull, - bool hasClippingNodes, - RenderInstructionContainer& instructions ); + void Prepare(BufferIndex updateBufferIndex, + SortedLayerPointers& sortedLayers, + RenderTask& renderTask, + bool cull, + bool hasClippingNodes, + RenderInstructionContainer& instructions); private: - /** * Undefine copy and assignment operators. */ - RenderInstructionProcessor( const RenderInstructionProcessor& renderInstructionProcessor ); ///< No definition - RenderInstructionProcessor& operator=( const RenderInstructionProcessor& renderInstructionProcessor ); ///< No definition + RenderInstructionProcessor(const RenderInstructionProcessor& renderInstructionProcessor); ///< No definition + RenderInstructionProcessor& operator=(const RenderInstructionProcessor& renderInstructionProcessor); ///< No definition private: - /** * @brief Sort render items * @param bufferIndex The buffer to read from * @param renderList to sort * @param layer where the Renderers are from * @param respectClippingOrder Sort with the correct clipping hierarchy. + * @param isOrthographicCamera Whether the camera is orthographic or not. */ - inline void SortRenderItems( BufferIndex bufferIndex, RenderList& renderList, Layer& layer, bool respectClippingOrder ); + inline void SortRenderItems(BufferIndex bufferIndex, RenderList& renderList, Layer& layer, bool respectClippingOrder, bool isOrthographicCamera); /// Sort comparitor function pointer type. - typedef bool ( *ComparitorPointer )( const SortAttributes& lhs, const SortAttributes& rhs ); - typedef std::vector< SortAttributes > SortingHelper; + using ComparitorPointer = bool (*)(const SortAttributes&, const SortAttributes&); - Dali::Vector< ComparitorPointer > mSortComparitors; ///< Contains all sort comparitors, used for quick look-up - RenderInstructionProcessor::SortingHelper mSortingHelper; ///< Helper used to sort Renderers + using SortingHelper = std::vector; + Dali::Vector mSortComparitors; ///< Contains all sort comparitors, used for quick look-up + RenderInstructionProcessor::SortingHelper mSortingHelper; ///< Helper used to sort Renderers }; - } // namespace SceneGraph } // namespace Internal