Eina_Bool remote_render;
+ Eina_Bool valid;
+
int version;
};
EINA_SAFETY_ON_NULL_RETURN(_rsm);
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
if (remote_surface->provider)
{
E_Comp_Wl_Remote_Surface *remote_surface;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
remote_surface->redirect = EINA_FALSE;
// _remote_surface_visible_set(remote_surface, EINA_FALSE);
double eradx, erady, epressure, eangle;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider->ec);
+ if (!remote_surface) return;
+ if (!remote_surface->provider) return;
+ if (!remote_surface->provider->ec) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
ec = provider->ec;
Ecore_Device *edev = NULL;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider->ec);
+ if (!remote_surface) return;
+ if (!remote_surface->provider) return;
+ if (!remote_surface->provider->ec) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
ec = provider->ec;
double eradx, erady, epressure, eangle;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider->ec);
+ if (!remote_surface) return;
+ if (!remote_surface->provider) return;
+ if (!remote_surface->provider->ec) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
ec = provider->ec;
E_Client *ec;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider->ec);
+ if (!remote_surface) return;
+ if (!remote_surface->provider) return;
+ if (!remote_surface->provider->ec) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
ec = provider->ec;
Ecore_Device_Class eclas;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface->provider->ec);
+ if (!remote_surface) return;
+ if (!remote_surface->provider) return;
+ if (!remote_surface->provider->ec) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
ec = provider->ec;
E_Comp_Wl_Remote_Surface *remote_surface;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
if (visibility_type == TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_INVISIBLE)
{
E_Client *owner = NULL;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
if (surface_resource)
owner = wl_resource_get_user_data(surface_resource);
E_Comp_Wl_Remote_Provider *provider;
remote_surface = wl_resource_get_user_data(remote_surface_resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
resource = wl_resource_create(client,
&tizen_remote_surface_region_interface,
E_Comp_Wl_Remote_Buffer *remote_buffer;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
remote_buffer = _e_comp_wl_remote_buffer_get(remote_buffer_resource);
EINA_SAFETY_ON_NULL_RETURN(remote_buffer);
E_Comp_Wl_Remote_Source *source = NULL;
remote_surface = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(remote_surface);
+ if (!remote_surface) return;
+ if (!remote_surface->valid) return;
source = remote_surface->source;
if (!source) return;
E_Comp_Wl_Remote_Provider *provider = NULL;
E_Comp_Wl_Remote_Source *source = NULL;
E_Client *ec;
- Eina_Bool new_source = EINA_FALSE;
int version;
pid_t pid;
EINA_SAFETY_ON_NULL_RETURN(_rsm);
+ version = wl_resource_get_version(res_remote_manager);
+ resource = wl_resource_create(client,
+ &tizen_remote_surface_interface,
+ version, id);
+ if (!resource)
+ {
+ ERR("Could not create tizen remote surface resource: %m");
+ wl_client_post_no_memory(client);
+ return;
+ }
+
+ remote_surface = E_NEW(E_Comp_Wl_Remote_Surface, 1);
+ remote_surface->resource = resource;
+ remote_surface->version = wl_resource_get_version(resource);
+ remote_surface->redirect = EINA_FALSE;
+ remote_surface->valid = EINA_FALSE;
+
+ wl_resource_set_implementation(resource,
+ &_remote_surface_interface,
+ remote_surface,
+ _remote_surface_cb_resource_destroy);
+
ec = e_pixmap_find_client_by_res_id(res_id);
if (!ec)
{
ERR("Could not find client by res_id(%u)", res_id);
- return;
+ goto fail;
}
if (!wl_tbm)
{
ERR("wayland_tbm resource is NULL");
- return;
+ goto fail;
}
wl_client_get_credentials(client, &pid, NULL, NULL);
- version = wl_resource_get_version(res_remote_manager);
-
provider = _remote_provider_find(ec);
if (!provider)
{
if (version >= TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_SINCE_VERSION)
{
/* TODO: privilege check */
-
if (ec->comp_data->sub.data)
{
ERR("Subsurface could not be source client");
- return;
+ goto fail;
}
/* if passed */
if (!source)
{
source = E_NEW(E_Comp_Wl_Remote_Source, 1);
- if (!source) return;
+ if (!source) goto fail;
source->ec = ec;
eina_hash_add(_rsm->source_hash, &ec, source);
}
-
- new_source = EINA_TRUE;
}
else
{
ERR("Could not support tizen_remote_surface to client :%d", pid);
- return;
+ goto fail;
}
}
- resource = wl_resource_create(client,
- &tizen_remote_surface_interface,
- version, id);
- if (!resource)
- {
- ERR("Could not create tizen remote surface resource: %m");
- wl_client_post_no_memory(client);
- if (new_source)
- {
- eina_hash_del(_rsm->source_hash, &ec, source);
- E_FREE(source);
- }
- return;
- }
-
-
- remote_surface = E_NEW(E_Comp_Wl_Remote_Surface, 1);
- remote_surface->resource = resource;
- remote_surface->version = wl_resource_get_version(remote_surface->resource);
- remote_surface->wl_tbm = wl_tbm;
- remote_surface->redirect = EINA_FALSE;
remote_surface->provider = provider;
remote_surface->source = source;
+ remote_surface->wl_tbm = wl_tbm;
/* Add destroy listener for wl_tbm resource */
remote_surface->tbm_destroy_listener.notify = _remote_surface_cb_tbm_destroy;
else if (source)
source->surfaces = eina_list_append(source->surfaces, remote_surface);
- wl_resource_set_implementation(resource,
- &_remote_surface_interface,
- remote_surface,
- _remote_surface_cb_resource_destroy);
-
RSMINF("Created resource(%p) ec(%p) provider(%p) source(%p) version(%d)",
NULL, NULL,
"SURFACE", remote_surface, resource, ec, provider, source, remote_surface->version);
+
+ remote_surface->valid = EINA_TRUE;
+ return;
+
+fail:
+ tizen_remote_surface_send_missing(resource);
}
remote_surface = wl_resource_get_user_data(remote_surface_resource);
if (!remote_surface) return;
+ if (!remote_surface->valid) return;
provider = remote_surface->provider;
if (!provider) return;