X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fcommon%2Frender-item.h;h=7dbd3fb0e56c27588f66d353cf21199f30045f51;hb=84fd5a0309ee1412b27af0b08e740bb13c734561;hp=d429452c826491071a262708db868974013a2c24;hpb=22bbf88067ca1c914055b2aa91f469760f12502f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/common/render-item.h b/dali/internal/render/common/render-item.h index d429452..7dbd3fb 100644 --- a/dali/internal/render/common/render-item.h +++ b/dali/internal/render/common/render-item.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__ -#define __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__ +#ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H +#define DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -45,6 +45,7 @@ struct RenderItem { /** * Construct a new RenderItem + * @return A pointer to a new RenderItem. */ static RenderItem* New(); @@ -54,17 +55,33 @@ struct RenderItem ~RenderItem(); /** + * @brief This method is an optimized calculation of a viewport-space AABB (Axis-Aligned-Bounding-Box). + * + * We use the model-view-matrix, but we do not use projection. Therefore we assume Z = 0. + * As the box is Axis-Aligned (in viewport space) rotations on Z axis are correctly delt with by expanding the box as necessary. + * Rotations on X & Y axis will resize the AABB, but it will not handle the projection error due to the new coordinates having non-zero Z values. + * + * Note: We pass in the viewport dimensions rather than allow the caller to modify the raw AABB in order to optimally generate the final result. + * + * @param[in] viewportWidth The width of the viewport to calculate for + * @param[in] viewportHeight The height of the viewport to calculate for + * @return The AABB coordinates in viewport-space (x, y, width, height) + */ + ClippingBox CalculateViewportSpaceAABB( const int viewportWidth, const int viewportHeight ) const; + + /** * Overriden delete operator. * Deletes the RenderItem from its global memory pool + * @param[in] A pointer to the RenderItem to delete. */ void operator delete( void* ptr ); - Matrix mModelMatrix; Matrix mModelViewMatrix; Vector3 mSize; Render::Renderer* mRenderer; Node* mNode; + const void* mTextureSet; //< Used for sorting only int mDepthIndex; bool mIsOpaque:1; @@ -78,6 +95,7 @@ private: // RenderItems should not be copied as they are heavy RenderItem( const RenderItem& item ); RenderItem& operator = ( const RenderItem& item ); + }; } // namespace SceneGraph @@ -86,4 +104,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__ +#endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H