[PATCH weston 12/14] ivi-shell: remove ivi_layout_layer_set_position API
Ucan, Emre (ADITG/SW1)
eucan at de.adit-jv.com
Fri Feb 26 15:58:35 UTC 2016
Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
ivi-shell/hmi-controller.c | 6 +++++-
ivi-shell/ivi-layout-export.h | 9 ---------
ivi-shell/ivi-layout-private.h | 5 +++--
ivi-shell/ivi-layout-transition.c | 3 ++-
ivi-shell/ivi-layout.c | 26 +-------------------------
tests/ivi_layout-internal-test.c | 35 ++---------------------------------
6 files changed, 13 insertions(+), 71 deletions(-)
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index e97fa0a..915725e 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -1572,12 +1572,16 @@ static void
layer_set_pos(struct ivi_layout_layer *layer, wl_fixed_t pos_x,
wl_fixed_t pos_y)
{
+ const struct ivi_layout_layer_properties *prop;
int32_t layout_pos_x = 0;
int32_t layout_pos_y = 0;
+ prop = ivi_layout_interface->get_properties_of_layer(layer);
+
layout_pos_x = wl_fixed_to_int(pos_x);
layout_pos_y = wl_fixed_to_int(pos_y);
- ivi_layout_interface->layer_set_position(layer, layout_pos_x, layout_pos_y);
+ ivi_layout_interface->layer_set_destination_rectangle(layer,
+ layout_pos_x, layout_pos_y, prop->dest_width, prop->dest_height);
ivi_layout_interface->commit_changes();
}
diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index 5e5b305..1a16b44 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -518,15 +518,6 @@ struct ivi_layout_interface {
int32_t width, int32_t height);
/**
- * \brief Sets the horizontal and vertical position of the ivi_layer.
- *
- * \return IVI_SUCCEEDED if the method call was successful
- * \return IVI_FAILED if the method call was failed
- */
- int32_t (*layer_set_position)(struct ivi_layout_layer *ivilayer,
- int32_t dest_x, int32_t dest_y);
-
- /**
* \brief Set the horizontal and vertical dimension of the layer.
*
* \return IVI_SUCCEEDED if the method call was successful
diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
index f0dba91..3a23ef4 100644
--- a/ivi-shell/ivi-layout-private.h
+++ b/ivi-shell/ivi-layout-private.h
@@ -200,8 +200,9 @@ int32_t
ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
bool newVisibility);
int32_t
-ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
- int32_t dest_x, int32_t dest_y);
+ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
+ int32_t x, int32_t y,
+ int32_t width, int32_t height);
int32_t
ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface **pSurface,
diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index df6112d..3b613a5 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -664,7 +664,8 @@ transition_move_layer_user_frame(struct ivi_layout_transition *transition)
const int32_t dest_y = data->start_y +
(data->end_y - data->start_y) * current;
- ivi_layout_layer_set_position(layer, dest_x, dest_y);
+ ivi_layout_layer_set_destination_rectangle(layer, dest_x, dest_y,
+ layer->prop.dest_width, layer->prop.dest_height);
}
static void
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 1b0b77f..9f4a0e2 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -1838,7 +1838,7 @@ ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer,
return IVI_SUCCEEDED;
}
-static int32_t
+int32_t
ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y,
int32_t width, int32_t height)
@@ -1891,29 +1891,6 @@ ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer,
return IVI_SUCCEEDED;
}
-int32_t
-ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
- int32_t dest_x, int32_t dest_y)
-{
- struct ivi_layout_layer_properties *prop = NULL;
-
- if (ivilayer == NULL) {
- weston_log("ivi_layout_layer_set_position: invalid argument\n");
- return IVI_FAILED;
- }
-
- prop = &ivilayer->pending.prop;
- prop->dest_x = dest_x;
- prop->dest_y = dest_y;
-
- if (ivilayer->prop.dest_x != dest_x || ivilayer->prop.dest_y != dest_y)
- ivilayer->event_mask |= IVI_NOTIFICATION_POSITION;
- else
- ivilayer->event_mask &= ~IVI_NOTIFICATION_POSITION;
-
- return IVI_SUCCEEDED;
-}
-
static int32_t
ivi_layout_layer_set_orientation(struct ivi_layout_layer *ivilayer,
enum wl_output_transform orientation)
@@ -2629,7 +2606,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
.layer_set_opacity = ivi_layout_layer_set_opacity,
.layer_set_source_rectangle = ivi_layout_layer_set_source_rectangle,
.layer_set_destination_rectangle = ivi_layout_layer_set_destination_rectangle,
- .layer_set_position = ivi_layout_layer_set_position,
.layer_set_dimension = ivi_layout_layer_set_dimension,
.layer_set_orientation = ivi_layout_layer_set_orientation,
.layer_add_surface = ivi_layout_layer_add_surface,
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 02e5524..fd2f0db 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -257,7 +257,8 @@ test_layer_position(struct test_context *ctx)
iassert(prop->dest_x == 0);
iassert(prop->dest_y == 0);
- iassert(lyt->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED);
+ iassert(lyt->layer_set_destination_rectangle(ivilayer, 20, 30,
+ prop->dest_width, prop->dest_height) == IVI_SUCCEEDED);
iassert(prop->dest_x == 0);
iassert(prop->dest_y == 0);
@@ -437,22 +438,6 @@ test_layer_bad_dimension(struct test_context *ctx)
}
static void
-test_layer_bad_position(struct test_context *ctx)
-{
- const struct ivi_layout_interface *lyt = ctx->layout_interface;
- struct ivi_layout_layer *ivilayer;
-
- ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
- iassert(ivilayer != NULL);
-
- iassert(lyt->layer_set_position(NULL, 20, 30) == IVI_FAILED);
-
- lyt->commit_changes();
-
- lyt->layer_destroy(ivilayer);
-}
-
-static void
test_layer_bad_source_rectangle(struct test_context *ctx)
{
const struct ivi_layout_interface *lyt = ctx->layout_interface;
@@ -528,20 +513,6 @@ test_commit_changes_after_dimension_set_layer_destroy(struct test_context *ctx)
}
static void
-test_commit_changes_after_position_set_layer_destroy(struct test_context *ctx)
-{
- const struct ivi_layout_interface *lyt = ctx->layout_interface;
- struct ivi_layout_layer *ivilayer;
-
- ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
- iassert(ivilayer != NULL);
-
- iassert(lyt->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED);
- lyt->layer_destroy(ivilayer);
- lyt->commit_changes();
-}
-
-static void
test_commit_changes_after_source_rectangle_set_layer_destroy(struct test_context *ctx)
{
const struct ivi_layout_interface *lyt = ctx->layout_interface;
@@ -1050,14 +1021,12 @@ run_internal_tests(void *data)
test_layer_bad_destination_rectangle(ctx);
test_layer_bad_orientation(ctx);
test_layer_bad_dimension(ctx);
- test_layer_bad_position(ctx);
test_layer_bad_source_rectangle(ctx);
test_layer_bad_properties(ctx);
test_commit_changes_after_visibility_set_layer_destroy(ctx);
test_commit_changes_after_opacity_set_layer_destroy(ctx);
test_commit_changes_after_orientation_set_layer_destroy(ctx);
test_commit_changes_after_dimension_set_layer_destroy(ctx);
- test_commit_changes_after_position_set_layer_destroy(ctx);
test_commit_changes_after_source_rectangle_set_layer_destroy(ctx);
test_commit_changes_after_destination_rectangle_set_layer_destroy(ctx);
test_layer_create_duplicate(ctx);
--
1.7.9.5
More information about the wayland-devel
mailing list