[PATCH weston v2 04/14] ivi-shell: remove ivi_layout_layer_get_opacity API

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Mar 4 12:50:16 UTC 2016


Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
 ivi-shell/ivi-layout-export.h     |    8 --------
 ivi-shell/ivi-layout-private.h    |    2 --
 ivi-shell/ivi-layout-transition.c |    2 +-
 ivi-shell/ivi-layout.c            |   12 ------------
 tests/ivi_layout-internal-test.c  |   16 +++++++---------
 5 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index c6dc09b..f58f5af 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -530,14 +530,6 @@ struct ivi_layout_interface {
 				     wl_fixed_t opacity);
 
 	/**
-	 * \brief Get the opacity of a ivi_layer.
-	 *
-	 * \return opacity if the method call was successful
-	 * \return wl_fixed_from_double(0.0) if the method call was failed
-	 */
-	wl_fixed_t (*layer_get_opacity)(struct ivi_layout_layer *ivilayer);
-
-	/**
 	 * \brief Set the area of a ivi_layer which should be used for the rendering.
 	 *
 	 * Only this part will be visible.
diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
index 0d126dd..9f0ca79 100644
--- a/ivi-shell/ivi-layout-private.h
+++ b/ivi-shell/ivi-layout-private.h
@@ -199,8 +199,6 @@ ivi_layout_get_surface_from_id(uint32_t id_surface);
 int32_t
 ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
 			     wl_fixed_t opacity);
-wl_fixed_t
-ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer);
 int32_t
 ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
 				bool newVisibility);
diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index 3c994a4..529bd56 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -831,7 +831,7 @@ ivi_layout_transition_fade_layer(
 		data = transition->private_data;
 
 		/* FIXME */
-		fixed_opacity = ivi_layout_layer_get_opacity(layer);
+		fixed_opacity = layer->prop.opacity;
 		now_opacity = wl_fixed_to_double(fixed_opacity);
 		remain = 0.0;
 
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 364df99..4475c94 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -1810,17 +1810,6 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
 	return IVI_SUCCEEDED;
 }
 
-wl_fixed_t
-ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer)
-{
-	if (ivilayer == NULL) {
-		weston_log("ivi_layout_layer_get_opacity: invalid argument\n");
-		return wl_fixed_from_double(0.0);
-	}
-
-	return ivilayer->prop.opacity;
-}
-
 static int32_t
 ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer,
 				      int32_t x, int32_t y,
@@ -2747,7 +2736,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
 	.get_layers_on_screen			= ivi_layout_get_layers_on_screen,
 	.layer_set_visibility			= ivi_layout_layer_set_visibility,
 	.layer_set_opacity			= ivi_layout_layer_set_opacity,
-	.layer_get_opacity			= ivi_layout_layer_get_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,
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 1ba53b7..3e31870 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -202,18 +202,16 @@ test_layer_opacity(struct test_context *ctx)
 	ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
 	iassert(ivilayer != NULL);
 
-	iassert(lyt->layer_get_opacity(ivilayer) == wl_fixed_from_double(1.0));
+	prop = lyt->get_properties_of_layer(ivilayer);
+	iassert(prop->opacity == wl_fixed_from_double(1.0));
 
 	iassert(lyt->layer_set_opacity(
 		ivilayer, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
 
-	iassert(lyt->layer_get_opacity(ivilayer) == wl_fixed_from_double(1.0));
+	iassert(prop->opacity == wl_fixed_from_double(1.0));
 
 	lyt->commit_changes();
 
-	iassert(lyt->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.5));
-
-	prop = lyt->get_properties_of_layer(ivilayer);
 	iassert(prop->opacity == wl_fixed_from_double(0.5));
 
 	lyt->layer_destroy(ivilayer);
@@ -430,6 +428,7 @@ test_layer_bad_opacity(struct test_context *ctx)
 {
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
 	struct ivi_layout_layer *ivilayer;
+	const struct ivi_layout_layer_properties *prop;
 
 	ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
 	iassert(ivilayer != NULL);
@@ -445,22 +444,21 @@ test_layer_bad_opacity(struct test_context *ctx)
 
 	lyt->commit_changes();
 
-	iassert(lyt->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.3));
+	prop = lyt->get_properties_of_layer(ivilayer);
+	iassert(prop->opacity == wl_fixed_from_double(0.3));
 
 	iassert(lyt->layer_set_opacity(
 		ivilayer, wl_fixed_from_double(1.1)) == IVI_FAILED);
 
 	lyt->commit_changes();
 
-	iassert(lyt->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.3));
+	iassert(prop->opacity == wl_fixed_from_double(0.3));
 
 	iassert(lyt->layer_set_opacity(
 		NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
 
 	lyt->commit_changes();
 
-	iassert(lyt->layer_get_opacity(NULL) == wl_fixed_from_double(0.0));
-
 	lyt->layer_destroy(ivilayer);
 }
 
-- 
1.7.9.5



More information about the wayland-devel mailing list