/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
};
-static void UpdateIndicatorImage( void* data, struct tizen_remote_surface* remoteSurface, struct wl_buffer* buffer, uint32_t time )
+struct wl_buffer* preBuffer;
+
+static void OnUpdateIndicatorImage( void* data, struct tizen_remote_surface* remoteSurface, struct wl_buffer* buffer, uint32_t time )
{
Dali::Internal::Adaptor::Indicator* indicator = static_cast< Dali::Internal::Adaptor::Indicator* >( data );
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;
}
-static void MissingIndicatorImage( void* data, struct tizen_remote_surface* surface )
+static void OnMissingIndicatorImage( void* data, struct tizen_remote_surface* surface )
{
}
static const struct tizen_remote_surface_listener remoteSurfaceCallback =
{
- UpdateIndicatorImage,
- MissingIndicatorImage,
+ OnUpdateIndicatorImage,
+ OnMissingIndicatorImage,
};
} // anonymous namespace
mCurrentSharedFile( 0 ),
mSharedBufferType( BUFFER_TYPE_SHM ),
mImpl( NULL ),
- mBackgroundVisible( false )
+ mBackgroundVisible( false ),
+ mTopMargin( 0 )
{
mIndicatorContentActor = Dali::Actor::New();
mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
mBackgroundVisible = false;
}
+ UpdateTopMargin();
}
void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
}
mVisible = visibleMode;
+ UpdateTopMargin();
if( mForegroundRenderer &&
( mForegroundRenderer.GetTextures().GetTexture( 0u ) ||
mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
mIndicatorActor.SetSize( mImageWidth, mImageHeight );
mEventActor.SetSize(mImageWidth, mImageHeight);
+ UpdateTopMargin();
}
}
if( mSharedFileInfo[n].mLock->RetrieveAndClearErrorStatus() )
{
DALI_LOG_ERROR( "### Indicator error: Cannot open lock file %s ###\n", mSharedFileInfo[n].mLockFileName.c_str() );
+
+ return;
}
CreateNewImage( n );
EINA_INLIST_FOREACH(globals, global)
{
- if (!strcmp(global->interface, "tizen_remote_surface_manager"))
+ 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, 1);
+ remoteSurfaceManager = ( struct tizen_remote_surface_manager* )wl_registry_bind( registry, global->id, &tizen_remote_surface_manager_interface, ( ( global->version < 2 )? global->version: 2 ) );
}
}
}
Dali::Stage::GetCurrent().KeepRendering( 0.0f );
}
+void Indicator::UpdateTopMargin()
+{
+ int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0;
+ if (mTopMargin != newMargin)
+ {
+ mTopMargin = newMargin;
+ mAdaptor->IndicatorSizeChanged( mTopMargin );
+ }
+}
+
void Indicator::UpdateVisibility()
{
if( CheckVisibleState() )