X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpage-turn-view%2Fpage-turn-landscape-view-impl.cpp;h=ed47428a6893595453a4dc85bb261c6285c98980;hb=adc2bdd0d2ccbb534b53eee116f43376ad5246d1;hp=64bac9ab39ba8d7f82884f49f920ecdf58892e99;hpb=2ddfbb9e23a7c3fc30e604236c41e0ef6d2ed6a2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp index 64bac9a..ed47428 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include namespace Dali { @@ -33,7 +35,10 @@ namespace Internal namespace { using namespace Dali; -TypeRegistration mType( typeid(Toolkit::PageTurnLandscapeView), typeid(Toolkit::PageTurnView), NULL ); + +DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnLandscapeView, Toolkit::PageTurnView, NULL ) +DALI_TYPE_REGISTRATION_END() + } PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize ) @@ -66,30 +71,17 @@ void PageTurnLandscapeView::OnPageTurnViewInitialize() mTurningPageLayer.SetParentOrigin( ParentOrigin::CENTER ); } -ImageActor PageTurnLandscapeView::NewPageFromRenderBuffer( int pageIndex ) -{ - int index = pageIndex % NUMBER_OF_CACHED_PAGES; - ImageActor page = ImageActor::New( mRenderedPage[ index ], - ImageActor::PixelArea( mPageSize.width, 0, mPageSize.width, mPageSize.height ) ); - if( pageIndex <= mTotalPageCount-1) - { - int nextIndex = (pageIndex+1) % NUMBER_OF_CACHED_PAGES; - page.Add( ImageActor::New( mRenderedPage[ nextIndex ],ImageActor::PixelArea( 0, 0, mPageSize.width, mPageSize.height ) ) ); - } - return page; -} - void PageTurnLandscapeView::OnAddPage( ImageActor newPage, bool isLeftSide ) { newPage.SetParentOrigin( ParentOrigin::CENTER ); - newPage.SetCullFace( CullBack ); + SetCullFace( newPage, CullBack ); if( 0 < newPage.GetChildCount() ) { ImageActor backImage = ImageActor::DownCast( newPage.GetChildAt( 0 ) ); backImage.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION ); backImage.SetSize( mPageSize ); - backImage.SetCullFace( CullFront ); + SetCullFace( backImage, CullFront ); backImage.SetZ( 0.25f * STATIC_PAGE_INTERVAL_DISTANCE ); } if( isLeftSide ) @@ -115,10 +107,12 @@ void PageTurnLandscapeView::SetPanActor( const Vector2& panPosition ) if( panPosition.x > mPageSize.width && mCurrentPageIndex < mTotalPageCount-1 ) { mPanActor = mPageActors[mCurrentPageIndex%NUMBER_OF_CACHED_PAGES]; // right side page + mTurningPageIndex = mCurrentPageIndex; } else if( panPosition.x <= mPageSize.width && mCurrentPageIndex > 0 ) { mPanActor = mPageActors[ (mCurrentPageIndex-1)%NUMBER_OF_CACHED_PAGES ]; // left side page + mTurningPageIndex = mCurrentPageIndex - 1; } else {