ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
ImageDimensions size,
- FittingMode::Type scalingMode,
+ FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection )
{
ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
ImageDimensions size,
- FittingMode::Type scalingMode,
+ FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection )
{
void TestPlatformAbstraction::LoadResource(const Integration::ResourceRequest& request)
{
std::ostringstream out;
- out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl;
+ out << "Type:" << request.GetType()->id << ", Path: " << request.GetPath() << std::endl ;
mTrace.PushCall("LoadResource", out.str());
if(mRequest != NULL)
}
/**
- * @copydoc PlatformAbstraction::SaveResource()
- */
-void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
-{
- mTrace.PushCall("SaveResource", "");
- if(mRequest != NULL)
- {
- delete mRequest;
- tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
- }
- mRequest = new Integration::ResourceRequest(request);
-}
-
-/**
* @copydoc PlatformAbstraction::CancelLoad()
*/
void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
{
cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
}
- if(mResources.saved)
- {
- cache.SaveComplete( mResources.savedId, mResources.savedType );
- }
- if(mResources.saveFailed)
- {
- cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
- }
}
/**
/**
* @copydoc PlatformAbstraction::LoadFile()
*/
-bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
{
mTrace.PushCall("LoadFile", "");
if( mLoadFileResult.loadResult )
}
/**
- * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
-bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
{
- mTrace.PushCall("LoadShaderBinFile", "");
+ mTrace.PushCall("LoadShaderBinaryFile", "");
if( mLoadFileResult.loadResult )
{
buffer = mLoadFileResult.buffer;
/**
* @copydoc PlatformAbstraction::SaveFile()
*/
-bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
+bool TestPlatformAbstraction::SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes) const
{
mTrace.PushCall("SaveFile", "");
return false;
case SuspendFunc: return mTrace.FindMethod("Suspend");
case ResumeFunc: return mTrace.FindMethod("Resume");
case LoadResourceFunc: return mTrace.FindMethod("LoadResource");
- case SaveResourceFunc: return mTrace.FindMethod("SaveResource");
case LoadFileFunc: return mTrace.FindMethod("LoadFile");
- case LoadShaderBinFileFunc: return mTrace.FindMethod("LoadShaderBinFile");
+ case LoadShaderBinaryFileFunc: return mTrace.FindMethod("LoadShaderBinaryFile");
+ case SaveShaderBinaryFileFunc: return mTrace.FindMethod("SaveShaderBinaryFile");
case SaveFileFunc: return mTrace.FindMethod("SaveFile");
case CancelLoadFunc: return mTrace.FindMethod("CancelLoad");
case GetResourcesFunc: return mTrace.FindMethod("GetResources");
mResources.loadFailure = failure;
}
-void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId savedId,
- Integration::ResourceTypeId savedType)
-{
- mResources.saved = true;
- mResources.savedId = savedId;
- mResources.savedType = savedType;
-}
-
-void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure)
-{
- mResources.saveFailed = true;
- mResources.saveFailedId = id;
- mResources.saveFailure = failure;
-}
-
Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
{
return mRequest;
mClosestSize = size;
}
-void TestPlatformAbstraction::SetLoadFileResult( bool result, std::vector< unsigned char >& buffer )
+void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
{
mLoadFileResult.loadResult = result;
if( result )
bool loadFailed;
Integration::ResourceId loadFailedId;
Integration::ResourceFailure loadFailure;
-
- bool saved;
- Integration::ResourceId savedId;
- Integration::ResourceTypeId savedType;
-
- bool saveFailed;
- Integration::ResourceId saveFailedId;
- Integration::ResourceFailure saveFailure;
};
struct LoadFileResult
}
bool loadResult;
- std::vector< unsigned char> buffer;
+ Dali::Vector< unsigned char> buffer;
};
/**
*/
virtual ImageDimensions GetClosestImageSize( const std::string& filename,
ImageDimensions size,
- FittingMode::Type scalingMode,
+ FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection );
*/
virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
ImageDimensions size,
- FittingMode::Type scalingMode,
+ FittingMode::Type fittingMode,
SamplingMode::Type samplingMode,
bool orientationCorrection );
virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
/**
- * @copydoc PlatformAbstraction::SaveResource()
- */
- virtual void SaveResource(const Integration::ResourceRequest& request);
-
- /**
* @copydoc PlatformAbstraction::CancelLoad()
*/
virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
* @copydoc PlatformAbstraction::SetDpi()
*/
virtual void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical);
+
/**
* @copydoc PlatformAbstraction::LoadFile()
*/
- virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+ virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
/**
- * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
*/
- virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+ virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer
+) const;
+
+ virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const { return true; }
/**
* @copydoc PlatformAbstraction::SaveFile()
*/
- virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
+ virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes) const;
virtual void JoinLoaderThreads();
SuspendFunc,
ResumeFunc,
LoadResourceFunc,
- SaveResourceFunc,
SaveFileFunc,
LoadFileFunc,
- LoadShaderBinFileFunc,
+ LoadShaderBinaryFileFunc,
+ SaveShaderBinaryFileFunc,
CancelLoadFunc,
GetResourcesFunc,
IsLoadingFunc,
void SetResourceLoadFailed(Integration::ResourceId id,
Integration::ResourceFailure failure);
- void SetResourceSaved(Integration::ResourceId savedId,
- Integration::ResourceTypeId savedType);
-
- void SetResourceSaveFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure);
-
Integration::ResourceRequest* GetRequest();
void DiscardRequest();
void SetClosestImageSize(const Vector2& size);
- void SetLoadFileResult( bool result, std::vector< unsigned char >& buffer );
+ void SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer );
void SetSaveFileResult( bool result );
// Default, HorizontalCenter, VerticalCenter - Ensure they do not change!
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalLeft, VerticalCenter
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalRight, VerticalCenter
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalLeft, VerticalTop
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalCenter, VerticalTop
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalRight, VerticalTop
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalLeft, VerticalBottom
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalCenter, VerticalBottom
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// HorizontalRight, VerticalBottom
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New();
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalRight);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
{
Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// ScaleToFill
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// ScaleToFitKeepAspect
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// ScaleToFillKeepAspect
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// ShrinkToFit
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
// ShrinkToFitKeepAspect
{
Alignment alignment = Alignment::New();
- alignment.Add(RenderableActor::New());
+ alignment.Add(Actor::New());
Stage::GetCurrent().Add(alignment);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- Actor actor = RenderableActor::New();
+ Actor actor = Actor::New();
alignment.Add(actor);
DALI_TEST_EQUALS(alignment.GetChildCount(), 1u, TEST_LOCATION);
DALI_TEST_EQUALS( dummyImpl.childAddCalled, false, TEST_LOCATION );
DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
- Actor actor = RenderableActor::New();
+ Actor actor = Actor::New();
dummy.Add(actor);
DALI_TEST_EQUALS( dummyImpl.childAddCalled, true, TEST_LOCATION );
DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
application.SendNotification();
DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
- Actor actor = RenderableActor::New();
+ Actor actor = Actor::New();
dummy.Add(actor);
DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
/**
* @brief Enable different blending mode for rendering.
*
- * @param[in] enable If false, the default blending function for RenderableActor is used.
+ * @param[in] enable If false, the default blending function if ImageActor is used.
*/
void SetBlendMode( bool enable );
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/rendering/cull-face.h>
namespace Dali
{
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 )
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/rendering/cull-face.h>
//INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
AlphaFunction::EASE_OUT, TimePeriod(PAGE_TURN_OVER_ANIMATION_DURATION*0.75f) );
animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunction::EASE_OUT );
animation.Play();
- ImageActor::DownCast(actor).SetCullFace( CullBack );
+
+ ImageActor imageActor = ImageActor::DownCast(actor);
+ if( imageActor )
+ {
+ SetCullFace( imageActor, CullBack );
+ }
animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver );
}
}
void PageTurnPortraitView::OnTurnedOver( Animation& animation )
{
- ImageActor::DownCast(mAnimationActorPair[animation]).SetCullFace( CullNone );
+ ImageActor imageActor = ImageActor::DownCast( mAnimationActorPair[ animation ] );
+ if( imageActor )
+ {
+ SetCullFace( imageActor, CullNone );
+ }
TurnedOver( animation );
}
* @brief Abstract base class for Text renderers.
*
* This is reponsible for rendering the glyphs from a ViewInterface in the specified positions.
- * It is implemented by returning a RenderableActor intended as the child of a UI control.
+ * It is implemented by returning an Actor intended as the child of a UI control.
*/
class Renderer : public RefObject
{
@code
/**
* @brief An enumeration of properties belonging to the ImageActor class.
- * Properties additional to RenderableActor.
+ * Properties additional to Actor.
*/
struct Property
{
// ignore GetNinePatchBorder use imageActor.border
{ "SetSortModifier", ImageActorApi::SetSortModifier, IMAGE_ACTOR_API },
{ "GetSortModifier", ImageActorApi::GetSortModifier, IMAGE_ACTOR_API },
- { "SetCullFace", ImageActorApi::SetCullFace, IMAGE_ACTOR_API },
- { "GetCullFace", ImageActorApi::GetCullFace, IMAGE_ACTOR_API },
{ "SetBlendMode", ImageActorApi::SetBlendMode, IMAGE_ACTOR_API },
{ "GetBlendMode", ImageActorApi::GetBlendMode, IMAGE_ACTOR_API },
{ "SetBlendFunc", ImageActorApi::SetBlendFunc, IMAGE_ACTOR_API },
}
/**
- * Set the face-culling mode for this actor.
- * @for ImageActor
- * @method setCullFace
- * @param {Number} cullMode
- * @example
- * // cull mode should be one of the following constants
- * dali.CULL_FACE_DISABLE // Face culling disabled
- * dali.CULL_FRONT_FACE // Cull front facing polygons
- * dali.CULL_BACK_FACE // Cull back facing polygons
- * dali.CULL_FRONT_AND_BACK_FACE // Cull front and back facing polygons
- * actor.SetCullFace( dali.CULL_FRONT_FACE );
- */
-void ImageActorApi::SetCullFace( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
- v8::Isolate* isolate = args.GetIsolate();
- v8::HandleScope handleScope( isolate );
- ImageActor imageActor = GetImageActor( isolate, args );
-
- bool found( false );
- int cullMode = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0 );
- if( !found )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "bad parameter" );
- return;
- }
-
- imageActor.SetCullFace( static_cast<Dali::CullFaceMode>( cullMode ) );
-
-}
-
-/**
- * Retrieve the face-culling mode for this actor.
- * @for ImageActor
- * @method getCullFace
- * @return {Number} cullMode
- * @example
- * // cull mode is one of the following
- * dali.CULL_FACE_DISABLE // Face culling disabled
- * dali.CULL_FRONT_FACE // Cull front facing polygons
- * dali.CULL_BACK_FACE // Cull back facing polygons
- * dali.CULL_FRONT_AND_BACK_FACE // Cull front and back facing polygon
- */
-void ImageActorApi::GetCullFace( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
- v8::Isolate* isolate = args.GetIsolate();
- v8::HandleScope handleScope( isolate );
- ImageActor imageActor = GetImageActor( isolate, args );
-
- args.GetReturnValue().Set( v8::Integer::New( isolate, imageActor.GetCullFace() ) );
-
-}
-
-/**
* Sets the blending mode.
*
* If blending is disabled (BLENDING_OFF) fade in and fade out animations do not work.
void GetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetSortModifier( const v8::FunctionCallbackInfo< v8::Value >& args );
void GetSortModifier( const v8::FunctionCallbackInfo< v8::Value >& args );
- void SetCullFace( const v8::FunctionCallbackInfo< v8::Value >& args );
- void GetCullFace( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetBlendMode( const v8::FunctionCallbackInfo< v8::Value >& args );
void GetBlendMode( const v8::FunctionCallbackInfo< v8::Value >& args );
void SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args );
{ "BLEND_EQUATION_SUBTRACT", BlendingEquation::SUBTRACT },
{ "BLEND_EQUATION_REVERSE_SUBTRACT", BlendingEquation::REVERSE_SUBTRACT },
-
- { "CULL_FACE_DISABLE", CullNone },
- { "CULL_FRONT_FACE", CullFront },
- { "CULL_BACK_FACE", CullBack },
- { "CULL_FRONT_AND_BACK_FACE", CullFrontAndBack },
-
{ "CAMERA_FREE_LOOK" , Camera::FREE_LOOK },
{ "CAMERA_LOOK_AT_TARGET" , Camera::LOOK_AT_TARGET },
{ "CAMERA_PERSPECTIVE_PROJECTION" , Camera::PERSPECTIVE_PROJECTION },