X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fcommon%2Frender-item.cpp;h=e5620366c9a16f4da7b17ce3f4d652b741873c4b;hb=55827866fcb8c7ee47581ac4335a3390472090e8;hp=011e154901cc48c11f168772a2b622be27d70bc1;hpb=929adaafa01b4b159e05686ecec104e2ffd2a958;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/common/render-item.cpp b/dali/internal/render/common/render-item.cpp old mode 100644 new mode 100755 index 011e154..e562036 --- a/dali/internal/render/common/render-item.cpp +++ b/dali/internal/render/common/render-item.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -46,11 +46,13 @@ RenderItem::RenderItem() : mModelMatrix( false ), mModelViewMatrix( false ), mSize(), + mUpdateSizeHint(), mRenderer( NULL ), mNode( NULL ), mTextureSet( NULL ), mDepthIndex( 0 ), - mIsOpaque( true ) + mIsOpaque( true ), + mPartialUpdateEnabled( false ) { } @@ -59,11 +61,22 @@ RenderItem::~RenderItem() } -ClippingBox RenderItem::CalculateViewportSpaceAABB( const int viewportWidth, const int viewportHeight ) const +ClippingBox RenderItem::CalculateViewportSpaceAABB( const int viewportWidth, const int viewportHeight, const bool useUpdateSizeHint ) const { // Calculate extent vector of the AABB: - const float halfActorX = mSize.x * 0.5f; - const float halfActorY = mSize.y * 0.5f; + float halfActorX; + float halfActorY; + if( useUpdateSizeHint ) + { + halfActorX = mUpdateSizeHint.x * 0.5f; + halfActorY = mUpdateSizeHint.y * 0.5f; + } + else + { + halfActorX = mSize.x * 0.5f; + halfActorY = mSize.y * 0.5f; + } + // To transform the actor bounds to screen-space, We do a fast, 2D version of a matrix multiply optimized for 2D quads. // This reduces float multiplications from 64 (16 * 4) to 12 (4 * 3). @@ -103,12 +116,15 @@ ClippingBox RenderItem::CalculateViewportSpaceAABB( const int viewportWidth, con // Return the AABB in screen-space pixels (x, y, width, height). // Note: This is a algebraic simplification of: ( viewport.x - aabb.width ) / 2 - ( ( aabb.width / 2 ) + aabb.x ) per axis. - Vector4 aabbInScreen( ( viewportWidth / 2 ) - aabb.z, ( viewportHeight / 2 ) - aabb.w, ( viewportWidth / 2 ) - aabb.x, ( viewportHeight / 2 ) - aabb.y ); - - int x = static_cast< int >( round( aabbInScreen.x ) ); - int y = static_cast< int >( round( aabbInScreen.y ) ); - int z = static_cast< int >( round( aabbInScreen.z ) ); - int w = static_cast< int >( round( aabbInScreen.w ) ); + Vector4 aabbInScreen( static_cast( viewportWidth ) * 0.5f - aabb.z, + static_cast( viewportHeight ) * 0.5f - aabb.w, + static_cast( viewportWidth ) * 0.5f - aabb.x, + static_cast( viewportHeight ) * 0.5f - aabb.y ); + + int x = static_cast< int >( roundf( aabbInScreen.x ) ); + int y = static_cast< int >( roundf( aabbInScreen.y ) ); + int z = static_cast< int >( roundf( aabbInScreen.z ) ); + int w = static_cast< int >( roundf( aabbInScreen.w ) ); return ClippingBox( x, y, z - x, w - y ); }