[3.0] Version up of tizen remote surface protocol 66/117066/1
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Thu, 2 Mar 2017 12:49:31 +0000 (21:49 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Thu, 2 Mar 2017 12:50:54 +0000 (21:50 +0900)
  - 2 to 3 version

Change-Id: Id61ba051d260d112e0274f93db66726709fdddae

adaptors/tizen/ecore-indicator-impl-tizen.cpp

index fcce43f..1904298 100644 (file)
@@ -312,12 +312,36 @@ static void OnUpdateIndicatorImage( void* data, struct tizen_remote_surface* rem
 
 static void OnMissingIndicatorImage( void* data, struct tizen_remote_surface* surface )
 {
+  DALI_LOG_ERROR( "Missing indicator remote surface\n" );
+}
+
+static void OnChangedIndicatorImage( void* data, struct tizen_remote_surface* remoteSurface, uint32_t type, struct wl_buffer* buffer,
+                                     int32_t fd, uint32_t fileSize, uint32_t time, struct wl_array* keys )
+{
+  Dali::Internal::Adaptor::Indicator* indicator = static_cast< Dali::Internal::Adaptor::Indicator* >( data );
+
+  if( indicator && type == TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM )
+  {
+    tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) );
+
+    indicator->UpdateIndicatorImage( tbmSurface );
+  }
+
+  if( preBuffer != NULL && tizen_remote_surface_get_version( remoteSurface ) >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION )
+  {
+    tizen_remote_surface_release( remoteSurface, preBuffer );
+  }
+
+  preBuffer = buffer;
+
+  close( fd );
 }
 
 static const struct tizen_remote_surface_listener remoteSurfaceCallback =
 {
   OnUpdateIndicatorImage,
   OnMissingIndicatorImage,
+  OnChangedIndicatorImage,
 };
 
 } // anonymous namespace
@@ -1043,7 +1067,7 @@ void Indicator::SetupNativeIndicatorImage( Ecore_Ipc_Event_Server_Data *epcEvent
     {
       if ( !strcmp( global->interface, "tizen_remote_surface_manager" ) )
       {
-        remoteSurfaceManager = ( struct tizen_remote_surface_manager* )wl_registry_bind( registry, global->id, &tizen_remote_surface_manager_interface, ( ( global->version < 2 )? global->version: 2 ) );
+        remoteSurfaceManager = ( struct tizen_remote_surface_manager* )wl_registry_bind( registry, global->id, &tizen_remote_surface_manager_interface, ( ( global->version < 3 )? global->version: 3 ) );
       }
     }
   }