wl_list_remove(&ivisurf->scaling.link);
ivisurf->surface = NULL;
+ ivisurf->view = NULL;
ivi_layout_surface_remove(ivisurf);
}
if ((ivilayer->event_mask & IVI_NOTIFICATION_OPACITY) ||
(ivisurf->event_mask & IVI_NOTIFICATION_OPACITY)) {
- struct weston_view *tmpview = NULL;
- wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) {
- if (tmpview == NULL) {
- continue;
- }
- tmpview->alpha = layer_alpha * surf_alpha;
- }
+ if (ivisurf->view == NULL)
+ return;
+ ivisurf->view->alpha = layer_alpha * surf_alpha;
}
}
update_surface_orientation(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *ivisurf)
{
- struct weston_view *view;
+ struct weston_view *view = ivisurf->view;
struct weston_matrix *matrix = &ivisurf->surface_rotation.matrix;
float width = 0.0f;
float height = 0.0f;
float sx = 1.0f;
float sy = 1.0f;
- wl_list_for_each(view, &ivisurf->surface->views, surface_link) {
- if (view != NULL) {
- break;
- }
- }
-
- if (view == NULL) {
+ if (view == NULL)
return;
- }
if ((ivilayer->prop.dest_width == 0) ||
(ivilayer->prop.dest_height == 0)) {
struct ivi_layout_surface *ivisurf)
{
struct weston_surface *es = ivisurf->surface;
- struct weston_view *view;
+ struct weston_view *view = ivisurf->view;
struct weston_matrix *matrix = &ivisurf->layer_rotation.matrix;
struct weston_output *output = NULL;
float width = 0.0f;
float sx = 1.0f;
float sy = 1.0f;
- wl_list_for_each(view, &ivisurf->surface->views, surface_link) {
- if (view != NULL) {
- break;
- }
- }
-
if (es == NULL || view == NULL) {
return;
}
static void
update_surface_position(struct ivi_layout_surface *ivisurf)
{
- struct weston_view *view;
+ struct weston_view *view = ivisurf->view;
float tx = (float)ivisurf->prop.dest_x;
float ty = (float)ivisurf->prop.dest_y;
struct weston_matrix *matrix = &ivisurf->surface_pos.matrix;
- wl_list_for_each(view, &ivisurf->surface->views, surface_link) {
- if (view != NULL) {
- break;
- }
- }
-
if (view == NULL) {
return;
}
update_layer_position(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *ivisurf)
{
- struct weston_view *view;
+ struct weston_view *view = ivisurf->view;
struct weston_matrix *matrix = &ivisurf->layer_pos.matrix;
float tx = (float)ivilayer->prop.dest_x;
float ty = (float)ivilayer->prop.dest_y;
- wl_list_for_each(view, &ivisurf->surface->views, surface_link) {
- if (view != NULL) {
- break;
- }
- }
-
if (view == NULL) {
return;
}
update_scale(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *ivisurf)
{
- struct weston_view *view;
+ struct weston_view *view = ivisurf->view;
struct weston_matrix *matrix = &ivisurf->scaling.matrix;
float sx = 0.0f;
float sy = 0.0f;
float lh = 0.0f;
float sh = 0.0f;
- wl_list_for_each(view, &ivisurf->surface->views, surface_link) {
- if (view != NULL) {
- break;
- }
- }
-
if (view == NULL) {
return;
}
struct ivi_layout_surface *ivisurf)
{
if (ivilayer->event_mask | ivisurf->event_mask) {
- struct weston_view *tmpview;
update_opacity(ivilayer, ivisurf);
update_layer_orientation(ivilayer, ivisurf);
update_layer_position(ivilayer, ivisurf);
ivisurf->update_count++;
- wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) {
- if (tmpview != NULL) {
- break;
- }
- }
-
- if (tmpview != NULL) {
- weston_view_geometry_dirty(tmpview);
+ if (ivisurf->view != NULL) {
+ weston_view_geometry_dirty(ivisurf->view);
}
if (ivisurf->surface != NULL) {
static struct weston_view *
ivi_layout_get_weston_view(struct ivi_layout_surface *surface)
{
- struct weston_view *tmpview = NULL;
-
- if(surface == NULL)
- return NULL;
-
- wl_list_for_each(tmpview, &surface->surface->views, surface_link)
- {
- if (tmpview != NULL) {
- break;
- }
- }
- return tmpview;
+ return (surface != NULL) ? surface->view : NULL;
}
static void
{
struct ivi_layout *layout = get_layout_instance();
struct ivi_layout_surface *ivisurf = NULL;
- struct weston_view *tmpview = NULL;
if (wl_surface == NULL) {
weston_log("ivi_layout_surface_create: invalid argument\n");
wl_resource_add_destroy_listener(wl_surface->resource,
&ivisurf->surface_destroy_listener);
- tmpview = weston_view_create(wl_surface);
- if (tmpview == NULL) {
+ ivisurf->view = weston_view_create(wl_surface);
+ if (ivisurf->view == NULL) {
weston_log("fails to allocate memory\n");
}