[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / video-view / video-view-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 2e34f27..9f6fc31
@@ -33,6 +33,7 @@
 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 
 namespace Dali
 {
@@ -88,7 +89,7 @@ const char* const CUSTOM_SAMPLER_TYPE_NAME( "samplerExternalOES" );
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   uniform highp   mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
+  uniform highp   vec3 uSize;\n
   \n
   void main()\n
   {\n
@@ -110,7 +111,7 @@ const char* VERTEX_SHADER_TEXTURE = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   varying mediump vec2 vTexCoord;\n
   uniform highp   mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
+  uniform highp   vec3 uSize;\n
   varying mediump vec2 sTexCoordRect;\n
   void main()\n
   {\n
@@ -139,6 +140,12 @@ VideoView::VideoView( Dali::VideoSyncMode syncMode )
   mIsUnderlay( true ),
   mSyncMode( syncMode )
 {
+  DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor )
+    {
+      return std::unique_ptr< Dali::Accessibility::Accessible >(
+        new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::VIDEO, true ) );
+    }
+  );
 }
 
 VideoView::~VideoView()
@@ -228,11 +235,6 @@ bool VideoView::IsLooping()
 
 void VideoView::Play()
 {
-  if( mOverlayRenderer )
-  {
-    Self().AddRenderer( mOverlayRenderer );
-  }
-
   mVideoPlayer.Play();
   mIsPlay = true;
 }
@@ -295,11 +297,6 @@ Dali::Toolkit::VideoView::VideoViewSignalType& VideoView::FinishedSignal()
 
 void VideoView::EmitSignalFinish()
 {
-  if( mOverlayRenderer )
-  {
-    Self().RemoveRenderer( mOverlayRenderer );
-  }
-
   if ( !mFinishedSignal.Empty() )
   {
     Dali::Toolkit::VideoView handle( GetOwner() );
@@ -552,9 +549,9 @@ void VideoView::SetDepthIndex( int depthIndex )
   }
 }
 
-void VideoView::OnStageConnection( int depth )
+void VideoView::OnSceneConnection( int depth )
 {
-  Control::OnStageConnection( depth );
+  Control::OnSceneConnection( depth );
 
   if( mIsUnderlay )
   {
@@ -562,9 +559,9 @@ void VideoView::OnStageConnection( int depth )
   }
 }
 
-void VideoView::OnStageDisconnection()
+void VideoView::OnSceneDisconnection()
 {
-  Control::OnStageDisconnection();
+  Control::OnSceneDisconnection();
 }
 
 void VideoView::OnSizeSet( const Vector3& targetSize )
@@ -660,6 +657,7 @@ void VideoView::SetWindowSurfaceTarget()
     mOverlayRenderer = Renderer::New( geometry, shader );
     mOverlayRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF );
   }
+  Self().AddRenderer( mOverlayRenderer );
 
   if( mIsPlay )
   {