当前位置: 首页>>代码示例>>C++>>正文


C++ RenderTaskList类代码示例

本文整理汇总了C++中RenderTaskList的典型用法代码示例。如果您正苦于以下问题:C++ RenderTaskList类的具体用法?C++ RenderTaskList怎么用?C++ RenderTaskList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RenderTaskList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:mettalla,项目名称:dali,代码行数:28,代码来源:utc-Dali-Magnifier.cpp

示例2: UtcDaliShadowViewActivateDeactivate

// Positive test case for a method
int UtcDaliShadowViewActivateDeactivate(void)
{
  ToolkitTestApplication application;
  tet_infoline("UtcDaliShadowViewActivateDeactivate");

  Toolkit::ShadowView view = Toolkit::ShadowView::New();
  DALI_TEST_CHECK( view );

  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );

  view.SetParentOrigin(ParentOrigin::CENTER);
  view.SetSize(Stage::GetCurrent().GetSize());
  view.Add(Actor::New());
  Stage::GetCurrent().Add(view);
  view.Activate();

  RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );

  view.Deactivate();

  RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:27,代码来源:utc-Dali-ShadowView.cpp

示例3: UtcDaliImageActorUseImageAlpha04

int UtcDaliImageActorUseImageAlpha04(void)
{
  TestApplication application;

  tet_infoline("Testing Dali::RenderableActor::SetUseImageAlpha()");

  FrameBufferImage image = FrameBufferImage::New( 100, 50, Pixel::RGBA8888 );
  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
  RenderTask task = taskList.GetTask( 0u );
  task.SetTargetFrameBuffer( image ); // To ensure frame buffer is connected
  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
  application.SendNotification();
  application.Render(0);

  ImageActor actor = ImageActor::New( image );
  application.SendNotification();
  application.Render(0);

  actor.SetBlendMode( BlendingMode::ON );
  actor.SetColor(Vector4(1.0, 1.0, 1.0, 1.0));
  actor.SetSize(100, 50);
  application.GetGlAbstraction().EnableCullFaceCallTrace(true); // For Enable(GL_BLEND)
  Stage::GetCurrent().Add(actor);

  application.SendNotification();
  application.Render();

  const TraceCallStack& callTrace = application.GetGlAbstraction().GetCullFaceTrace();
  DALI_TEST_EQUALS( BlendDisabled( callTrace ), false, TEST_LOCATION );
  DALI_TEST_EQUALS( BlendEnabled( callTrace), true, TEST_LOCATION );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:32,代码来源:utc-Dali-ImageActor.cpp

示例4: CreateRenderTasks

void SpreadFilter::CreateRenderTasks()
{
  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();

  // perform a horizontal blur targeting the internal buffer
  mRenderTaskForHorz = taskList.CreateTask();
  mRenderTaskForHorz.SetRefreshRate( mRefreshOnDemand ? RenderTask::REFRESH_ONCE : RenderTask::REFRESH_ALWAYS );
  mRenderTaskForHorz.SetSourceActor( mActorForInput );
  mRenderTaskForHorz.SetExclusive(true);
  mRenderTaskForHorz.SetInputEnabled( false );
  mRenderTaskForHorz.SetClearEnabled( true );
  mRenderTaskForHorz.SetClearColor( mBackgroundColor );
  mRenderTaskForHorz.SetTargetFrameBuffer( mImageForHorz );
  mRenderTaskForHorz.SetCameraActor( mCameraActor );

  // use the internal buffer and perform a horizontal blur targeting the output buffer
  mRenderTaskForVert = taskList.CreateTask();
  mRenderTaskForVert.SetRefreshRate( mRefreshOnDemand ? RenderTask::REFRESH_ONCE : RenderTask::REFRESH_ALWAYS );
  mRenderTaskForVert.SetSourceActor( mActorForHorz );
  mRenderTaskForVert.SetExclusive(true);
  mRenderTaskForVert.SetInputEnabled( false );
  mRenderTaskForVert.SetClearEnabled( true );
  mRenderTaskForVert.SetClearColor( mBackgroundColor );
  mRenderTaskForVert.SetTargetFrameBuffer( mOutputImage );
  mRenderTaskForVert.SetCameraActor( mCameraActor );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:26,代码来源:spread-filter.cpp

示例5: UtcDaliHitTestAlgorithmOrtho02

int UtcDaliHitTestAlgorithmOrtho02(void)
{
  TestApplication application;
  tet_infoline("Testing Dali::HitTestAlgorithm with offset Ortho camera()");

  Stage stage = Stage::GetCurrent();
  RenderTaskList renderTaskList = stage.GetRenderTaskList();
  RenderTask defaultRenderTask = renderTaskList.GetTask(0u);
  Dali::CameraActor cameraActor = defaultRenderTask.GetCameraActor();

  Vector2 stageSize ( stage.GetSize() );
  cameraActor.SetOrthographicProjection(-stageSize.x * 0.3f,  stageSize.x * 0.7f,
                                         stageSize.y * 0.3f, -stageSize.y * 0.7f,
                                         800.0f, 4895.0f);
  cameraActor.SetPosition(0.0f, 0.0f, 1600.0f);

  Vector2 actorSize( stageSize * 0.5f );
  // Create two actors with half the size of the stage and set them to be partially overlapping
  Actor blue = Actor::New();
  blue.SetName( "Blue" );
  blue.SetAnchorPoint( AnchorPoint::TOP_LEFT );
  blue.SetParentOrigin( Vector3(0.2f, 0.2f, 0.5f) );
  blue.SetSize( actorSize );
  blue.SetZ(30.0f);

  Actor green = Actor::New( );
  green.SetName( "Green" );
  green.SetAnchorPoint( AnchorPoint::TOP_LEFT );
  green.SetParentOrigin( Vector3(0.4f, 0.4f, 0.5f) );
  green.SetSize( actorSize );

  // Add the actors to the view
  stage.Add( blue );
  stage.Add( green );

  // Render and notify
  application.SendNotification();
  application.Render(0);
  application.Render(10);

  HitTestAlgorithm::Results results;
  HitTest(stage, Vector2( 240.0f, 400.0f ), results, &DefaultIsActorTouchableFunction);
  DALI_TEST_CHECK( results.actor == green );
  DALI_TEST_EQUALS( results.actorCoordinates, actorSize * 0.6f, TEST_LOCATION );

  HitTest(stage, Vector2::ZERO, results, &DefaultIsActorTouchableFunction);
  DALI_TEST_CHECK( results.actor == blue );
  DALI_TEST_EQUALS( results.actorCoordinates, Vector2::ZERO, TEST_LOCATION );

  HitTest(stage, stageSize, results, &DefaultIsActorTouchableFunction);
  DALI_TEST_CHECK( ! results.actor );
  DALI_TEST_EQUALS( results.actorCoordinates, Vector2::ZERO, TEST_LOCATION );

  // Just inside green
  HitTest(stage, stageSize*0.69f, results, &DefaultIsActorTouchableFunction);
  DALI_TEST_CHECK( results.actor == green );
  DALI_TEST_EQUALS( results.actorCoordinates, actorSize * 0.98f, TEST_LOCATION );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:59,代码来源:utc-Dali-HitTestAlgorithm.cpp

示例6: RenderTaskList

RenderTaskList* RenderTaskList::New( EventThreadServices& eventServices, RenderTaskDefaults& defaults, bool systemLevel )
{
  RenderTaskList* taskList = new RenderTaskList( eventServices, defaults, systemLevel );

  taskList->Initialize( eventServices.GetUpdateManager() );

  return taskList;
}
开发者ID:mettalla,项目名称:dali,代码行数:8,代码来源:render-task-list-impl.cpp

示例7: RenderTaskList

RenderTaskList* RenderTaskList::New( UpdateManager& updateManager, RenderTaskDefaults& defaults, bool systemLevel )
{
  RenderTaskList* taskList = new RenderTaskList( updateManager.GetEventToUpdate(), defaults, systemLevel );

  taskList->Initialize( updateManager );

  return taskList;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:8,代码来源:render-task-list-impl.cpp

示例8: RemoveRenderTasks

void GaussianBlurView::RemoveRenderTasks()
{
    RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();

    taskList.RemoveTask(mRenderChildrenTask);
    taskList.RemoveTask(mHorizBlurTask);
    taskList.RemoveTask(mVertBlurTask);
    taskList.RemoveTask(mCompositeTask);
}
开发者ID:noyangunday,项目名称:dali,代码行数:9,代码来源:gaussian-blur-view-impl.cpp

示例9: RemoveRenderTasks

void ShadowView::RemoveRenderTasks()
{
  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();

  taskList.RemoveTask(mRenderSceneTask);
  mRenderSceneTask.Reset();

  mBlurFilter.Disable();
}
开发者ID:mettalla,项目名称:dali,代码行数:9,代码来源:shadow-view-impl.cpp

示例10: UtcDaliRenderTaskListCreateTask

int UtcDaliRenderTaskListCreateTask(void)
{
  TestApplication application;

  tet_infoline("Testing RenderTaskList::CreateTask()");

  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );

  taskList.CreateTask();
  DALI_TEST_CHECK( 2u == taskList.GetTaskCount() );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:13,代码来源:utc-Dali-RenderTaskList.cpp

示例11: UtcDaliRenderTaskListDownCast

int UtcDaliRenderTaskListDownCast(void)
{
  TestApplication application;

  tet_infoline("Testing RenderTaskList::DownCast()");

  BaseHandle base = Stage::GetCurrent().GetRenderTaskList();

  RenderTaskList taskList = RenderTaskList::DownCast( base );

  DALI_TEST_CHECK( taskList );

  // Try calling a method
  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:16,代码来源:utc-Dali-RenderTaskList.cpp

示例12: UtcDaliBubbleEmitterSetBackground

int UtcDaliBubbleEmitterSetBackground(void)
{
  ToolkitTestApplication application;
  tet_infoline( " UtcDaliBubbleEmitterSetBackground " );

  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));

  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
  unsigned int taskCount = taskList.GetTaskCount();

  Image bgImage = CreateSolidColorImage( application, Color::RED, 50, 50 );
  emitter.SetBackground( bgImage, Vector3(0.f, 0.f, 0.5f) );

  DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount+1 );

  Wait(application, 500);
  DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount );
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:20,代码来源:utc-Dali-BubbleEmitter.cpp

示例13: InitializeRenderTask

void Magnifier::InitializeRenderTask()
{
  Stage stage = Stage::GetCurrent();

  RenderTaskList taskList = stage.GetRenderTaskList();

  mTask = taskList.CreateTask();
  mTask.SetInputEnabled(false);
  mTask.SetClearColor(Vector4(0.5f, 0.5f, 0.5f, 1.0f));
  mTask.SetClearEnabled(true);

  mCameraActor = CameraActor::New();
  mCameraActor.SetType(Camera::FREE_LOOK);
  mCameraActor.SetRotation(Quaternion(M_PI, Vector3::YAXIS)); // Look at stage

  stage.Add(mCameraActor);
  mTask.SetCameraActor( mCameraActor );

  SetFrameVisibility(true);
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:20,代码来源:magnifier-impl.cpp

示例14: CreateRenderTasks

void ShadowView::CreateRenderTasks()
{
  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();

  // We want the first task to render the scene from the light
  mRenderSceneTask = taskList.CreateTask();

  mRenderSceneTask.SetCameraActor( mCameraActor );
  mRenderSceneTask.SetSourceActor( mChildrenRoot );
  mRenderSceneTask.SetTargetFrameBuffer( mSceneFromLightRenderTarget );
  mRenderSceneTask.SetInputEnabled( false );
  mRenderSceneTask.SetClearEnabled( true );

  // background color for render task should be the shadow color, but with alpha 0
  // we don't want to blend the edges of the content with a BLACK at alpha 0, but
  // the same shadow color at alpha 0.
  mRenderSceneTask.SetClearColor( mCachedBackgroundColor );

  mBlurFilter.Enable();
}
开发者ID:mettalla,项目名称:dali,代码行数:20,代码来源:shadow-view-impl.cpp

示例15: UtcDaliGaussianBlurViewActivateOnce

int UtcDaliGaussianBlurViewActivateOnce(void)
{
  ToolkitTestApplication application;
  tet_infoline("UtcDaliGaussianBlurActivateOnce");

  Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
  DALI_TEST_CHECK( view );

  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );

  view.SetParentOrigin(ParentOrigin::CENTER);
  view.SetSize(Stage::GetCurrent().GetSize());
  view.Add(Actor::New());
  Stage::GetCurrent().Add(view);
  view.ActivateOnce();

  RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
  DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
  application.Render();

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:23,代码来源:utc-Dali-GaussianBlurView.cpp


注:本文中的RenderTaskList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。