本文整理汇总了C++中ToolkitTestApplication::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolkitTestApplication::Render方法的具体用法?C++ ToolkitTestApplication::Render怎么用?C++ ToolkitTestApplication::Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolkitTestApplication
的用法示例。
在下文中一共展示了ToolkitTestApplication::Render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtcDaliMagnifierMagnificationFactor
int UtcDaliMagnifierMagnificationFactor(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
float magnificationFactor( 200.0f );
DALI_TEST_CHECK( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >() != magnificationFactor );
view.SetProperty( Magnifier::Property::MAGNIFICATION_FACTOR, magnificationFactor );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), magnificationFactor, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), magnificationFactor, TEST_LOCATION );
view.SetProperty( Magnifier::Property::MAGNIFICATION_FACTOR, 1.0f );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), 1.0f, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), 1.0f, TEST_LOCATION );
END_TEST;
}
示例2: UtcDaliMagnifierSetSourceActorP
int UtcDaliMagnifierSetSourceActorP(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
RenderTaskList renderTaskList = stage.GetRenderTaskList();
DALI_TEST_CHECK( renderTaskList.GetTaskCount() > 1 );
Actor actor = Actor::New();
stage.Add( actor );
DALI_TEST_CHECK( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor() != actor );
view.SetSourceActor( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor(), actor, TEST_LOCATION );
END_TEST;
}
示例3: UtcDaliControlImplStyleChange
int UtcDaliControlImplStyleChange(void)
{
ToolkitTestApplication application;
DummyControl dummy = DummyControl::New( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
// Add a Control and normal Actor as children
DummyControl dummyChild = DummyControl::New();
dummy.Add(dummyChild);
Actor actor = Actor::New();
dummy.Add(actor);
DALI_TEST_EQUALS( dummyImpl.styleChangeCalled, false, TEST_LOCATION );
StyleChange styleChange;
styleChange.defaultFontChange = true;
Dali::StyleMonitor styleMonitor = application.GetAdaptor().GetToolkitStyleMonitor();
styleMonitor.EmitStyleChangeSignal(styleChange);
DALI_TEST_EQUALS( dummyImpl.styleChangeCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
END_TEST;
}
示例4: UtcDaliMagnifierFrameVisibility
int UtcDaliMagnifierFrameVisibility(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, false );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, true );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
END_TEST;
}
示例5: UtcDaliMagnifierSourcePosition
int UtcDaliMagnifierSourcePosition(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
Vector3 position( 100.0f, 200.0f, 300.0f );
DALI_TEST_CHECK( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >() != position );
view.SetProperty( Magnifier::Property::SOURCE_POSITION, position );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), position, TEST_LOCATION );
view.SetProperty( Magnifier::Property::SOURCE_POSITION, Vector3::ONE );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
END_TEST;
}
示例6: UtcDaliTextInputSetEditableAndIsEditable
int UtcDaliTextInputSetEditableAndIsEditable(void)
{
ToolkitTestApplication application;
tet_infoline("Testing SetEditable And IsEditable");
const std::string initialString = "initial text";
TextInput textInput = TextInput::New(); // create empty TextInput
textInput.SetInitialText( initialString );
Stage::GetCurrent().Add(textInput);
application.SendNotification();
application.Render();
bool editableStateFalse ( false );
bool editableStateTrue ( true );
textInput.SetEditable ( editableStateFalse );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( editableStateFalse, textInput.IsEditable() , TEST_LOCATION);
textInput.SetEditable ( editableStateTrue );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( editableStateTrue, textInput.IsEditable() , TEST_LOCATION);
END_TEST;
}
示例7: UtcDaliControlRendererSetOnOffStage
int UtcDaliControlRendererSetOnOffStage(void)
{
ToolkitTestApplication application;
tet_infoline( "UtcDaliControlRendererSetDepthIndex" );
RendererFactory factory = RendererFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("renderer-type", "color-renderer");
propertyMap.Insert("blend-color", Color::BLUE);
ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
controlRenderer.SetOnStage( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
controlRenderer.SetOffStage( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
示例8: UtcDaliPushButtonPressed
static void UtcDaliPushButtonPressed()
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliPushButtonPressed");
PushButton pushButton = PushButton::New();
pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
pushButton.SetPosition( 240, 400 );
pushButton.SetSize( 100, 100 );
Stage::GetCurrent().Add( pushButton );
application.SendNotification();
application.Render();
gPushButtonPressed = false;
// connect to its touch signal
pushButton.PressedSignal().Connect( &PushButtonPressed );
Dali::Integration::TouchEvent eventDown;
eventDown.AddPoint( pointDownInside );
// flush the queue and render once
application.SendNotification();
application.Render();
application.ProcessEvent( eventDown );
DALI_TEST_CHECK( gPushButtonPressed );
}
示例9: utcDaliTextFieldEvent03
int utcDaliTextFieldEvent03(void)
{
ToolkitTestApplication application;
tet_infoline(" utcDaliTextFieldEvent03");
// Checks if the highlight actor is created.
TextField field = TextField::New();
DALI_TEST_CHECK( field );
Stage::GetCurrent().Add( field );
field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
field.SetSize( 30.f, 50.f );
field.SetParentOrigin( ParentOrigin::TOP_LEFT );
field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
// Render and notify
application.SendNotification();
application.Render();
// Tap first to get the focus.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
// Render and notify
application.SendNotification();
application.Render();
// Double tap to select a word.
application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
// Render and notify
application.SendNotification();
application.Render();
// The offscreen root actor should have three actors: the camera, a renderer and the highlight actor.
Actor offscreenRoot = field.GetChildAt( 1u );
DALI_TEST_CHECK( offscreenRoot.IsLayer() );
CameraActor camera = CameraActor::DownCast( offscreenRoot.GetChildAt( 0u ) );
DALI_TEST_CHECK( camera );
Renderer renderer = offscreenRoot.GetChildAt( 1u ).GetRendererAt( 0u );
DALI_TEST_CHECK( renderer );
Renderer highlight = offscreenRoot.GetChildAt( 2u ).GetRendererAt( 0u );
DALI_TEST_CHECK( highlight );
END_TEST;
}
示例10: UtcDaliGridLayoutConstraintUp
static void UtcDaliGridLayoutConstraintUp()
{
ToolkitTestApplication application;
// Create the ItemView actor
TestItemFactory factory;
ItemView view = ItemView::New(factory);
Vector3 vec(480.0f, 800.0f, 0.0f);
GridLayoutPtr gridLayout = GridLayout::New();
gridLayout->SetNumberOfColumns(6);
view.SetName("view actor");
view.AddLayout(*gridLayout);
view.SetSize(vec);
Stage::GetCurrent().Add(view);
gridLayout->SetOrientation(ControlOrientation::Up);
view.ActivateLayout(0, vec, 0.0f);
application.SendNotification();
application.Render(0);
// render 10 frames
for(int i = 0; i < 10; ++i)
{
application.Render(16); // 60hz frames
}
// Confirm: we have actors in the view and they are positioned some distance from the origin.
int nonZeroCount = 0;
int elementsFound = 0;
for(unsigned int i = 0; i < 10; i++)
{
Actor testActor = view.GetItem(i);
if (testActor)
{
elementsFound++;
Vector3 pos = testActor.GetCurrentPosition();
if (pos.LengthSquared() > 0.0f)
{
nonZeroCount++;
}
}
}
DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
ItemLayoutPtr layout = gridLayout;
layout->GetClosestOnScreenLayoutPosition(0, 0.0f, vec);
int nextItem = layout->GetNextFocusItemID(0, 10, Dali::Toolkit::Control::Right, false);
DALI_TEST_CHECK(nextItem == 1);
Stage::GetCurrent().Remove(view);
}
示例11: UtcDaliRollLayoutConstraintDown
int UtcDaliRollLayoutConstraintDown(void)
{
ToolkitTestApplication application;
// Create the ItemView actor
TestItemFactory factory;
ItemView view = ItemView::New(factory);
Vector3 vec(480.0f, 800.0f, 0.0f);
RollLayoutPtr rollLayout = RollLayout::New();
view.SetName("view actor");
view.AddLayout(*rollLayout);
view.SetSize(vec);
Stage::GetCurrent().Add(view);
rollLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
application.SendNotification();
application.Render(0);
// render 10 frames
for(int i = 0; i < 10; ++i)
{
application.Render(16); // 60hz frames
}
// Confirm: we have actors in the view and they are positioned some distance from the origin.
int nonZeroCount = 0;
int elementsFound = 0;
for(unsigned int i = 0; i < 10; i++)
{
Actor testActor = view.GetItem(i);
if (testActor)
{
elementsFound++;
Vector3 pos = testActor.GetCurrentPosition();
if (pos.LengthSquared() > 0.0f)
{
nonZeroCount++;
}
}
}
DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
Stage::GetCurrent().Remove(view);
END_TEST;
}
示例12: UtcDaliDisplacementEffectTestSetProperty
// Positive test case for a method
int UtcDaliDisplacementEffectTestSetProperty(void)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliDisplacementEffectTestSetProperty");
Toolkit::DisplacementEffect effect = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::DISPLACED);
DALI_TEST_CHECK( effect );
ImageActor actor = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
actor.SetSize( 100.0f, 100.0f );
actor.SetShaderEffect( effect );
Stage::GetCurrent().Add( actor );
Toolkit::DisplacementEffect effect2 = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::FIXED);
DALI_TEST_CHECK( effect );
ImageActor actor2 = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
actor2.SetSize( 100.0f, 100.0f );
actor2.SetShaderEffect( effect2 );
Stage::GetCurrent().Add( actor2 );
Vector3 testVector3 = Vector3(45.0f, 55.0f, 65.0f);
float testFloat = 0.623f;
effect.SetLightDirection(testVector3);
effect.SetAmbientLightColorProperty(testVector3);
effect.SetDiffuseLightColorProperty(testVector3);
effect.SetStateProperty(testFloat);
effect.SetLightingMultiplierProperty(testFloat);
effect.SetHeightScaleProperty(testFloat);
effect2.SetFixedNormalProperty(testVector3);
application.SendNotification();
application.Render(0);
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightDirectionPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetAmbientLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetDiffuseLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetStatePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightingMultiplierPropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetHeightScalePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
Vector3 normalizedVector3(testVector3);
normalizedVector3.Normalize();
DALI_TEST_EQUALS( effect2.GetProperty( effect2.GetPropertyIndex( effect2.GetFixedNormalPropertyName() ) ).Get<Vector3>(), normalizedVector3, TEST_LOCATION );
END_TEST;
}
示例13: UtcDaliControlImplTouchEvent
int UtcDaliControlImplTouchEvent(void)
{
ToolkitTestApplication application;
{
DummyControl dummy = DummyControl::New( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
dummy.SetSize(100.0f, 100.0f);
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
DALI_TEST_EQUALS( dummyImpl.touchEventCalled, false, TEST_LOCATION );
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
}
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
dummy.SetSize(100.0f, 100.0f);
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
Integration::TouchEvent touchEvent(1);
TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
Stage::GetCurrent().Remove(dummy);
}
END_TEST;
}
示例14: UtcDaliIrisEffectCustomValues
static void UtcDaliIrisEffectCustomValues()
{
ToolkitTestApplication application;
Toolkit::IrisEffect effect = Toolkit::IrisEffect::New();
DALI_TEST_CHECK( effect );
BitmapImage image = CreateBitmapImage();
ImageActor actor = ImageActor::New( image );
actor.SetSize( 100.0f, 100.0f );
const float radiusValue(23.0f);
const Vector2 centerValue(0.2f, 0.7f);
const float blendFactorValue(10.0f);
effect.SetRadius( radiusValue );
effect.SetCenter( centerValue );
effect.SetBlendFactor( blendFactorValue );
actor.SetShaderEffect(effect);
Stage::GetCurrent().Add(actor);
application.SendNotification();
application.Render();
TestGlAbstraction& gl = application.GetGlAbstraction();
DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetRadiusPropertyName().c_str(), radiusValue ) );
DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetCenterPropertyName().c_str(), centerValue ) );
DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetBlendFactorPropertyName().c_str(), blendFactorValue ) );
}
示例15: UtcDaliSpotCustomValuesEffect
int UtcDaliSpotCustomValuesEffect(void)
{
ToolkitTestApplication application;
Toolkit::SpotEffect effect = Toolkit::SpotEffect::New();
DALI_TEST_CHECK( effect );
BitmapImage image = CreateBitmapImage();
ImageActor actor = ImageActor::New( image );
actor.SetSize( 100.0f, 100.0f );
effect.SetCenter( Vector2(480.0f, 800.0f) );
effect.SetRadius( 5.0f );
actor.SetShaderEffect( effect );
Stage::GetCurrent().Add( actor );
application.SendNotification();
application.Render();
// Gets converted to opengl viewport coordinates
DALI_TEST_CHECK(
application.GetGlAbstraction().CheckUniformValue(
effect.GetCenterPropertyName().c_str(),
Vector2(480.0f, 800.0f) ) );
DALI_TEST_CHECK(
application.GetGlAbstraction().CheckUniformValue(
effect.GetRadiusPropertyName().c_str(),
5.0f ) );
END_TEST;
}