[PATCH weston 03/14] ivi-shell: remove ivi_layout_surface_get_opacity API
Ucan, Emre (ADITG/SW1)
eucan at de.adit-jv.com
Fri Feb 26 15:58:06 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 | 6 +++---
ivi-shell/ivi-layout.c | 12 ------------
tests/ivi_layout-test-plugin.c | 24 +++++++-----------------
5 files changed, 10 insertions(+), 42 deletions(-)
diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index fc0e050..c6dc09b 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -289,14 +289,6 @@ struct ivi_layout_interface {
wl_fixed_t opacity);
/**
- * \brief Get the opacity of a ivi_surface.
- *
- * \return opacity if the method call was successful
- * \return wl_fixed_from_double(0.0) if the method call was failed
- */
- wl_fixed_t (*surface_get_opacity)(struct ivi_layout_surface *ivisurf);
-
- /**
* \brief Set the area of a ivi_surface which should be used for the rendering.
*
* \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 342ef4a..0d126dd 100644
--- a/ivi-shell/ivi-layout-private.h
+++ b/ivi-shell/ivi-layout-private.h
@@ -191,8 +191,6 @@ ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
int32_t
ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
wl_fixed_t opacity);
-wl_fixed_t
-ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf);
int32_t
ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
bool newVisibility);
diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index fd8ce85..3c994a4 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -540,7 +540,7 @@ ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
{
struct ivi_layout_transition *transition;
bool is_visible = surface->prop.visibility;
- wl_fixed_t dest_alpha = ivi_layout_surface_get_opacity(surface);
+ wl_fixed_t dest_alpha = surface->prop.opacity;
struct store_alpha *user_data = NULL;
wl_fixed_t start_alpha = 0.0;
struct fade_view_data *data = NULL;
@@ -549,7 +549,7 @@ ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface,
IVI_LAYOUT_TRANSITION_VIEW_FADE,
surface);
if (transition) {
- start_alpha = ivi_layout_surface_get_opacity(surface);
+ start_alpha = surface->prop.opacity;
user_data = transition->user_data;
data = transition->private_data;
@@ -604,7 +604,7 @@ ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface,
uint32_t duration)
{
struct ivi_layout_transition *transition;
- wl_fixed_t start_alpha = ivi_layout_surface_get_opacity(surface);
+ wl_fixed_t start_alpha = surface->prop.opacity;
struct store_alpha* user_data = NULL;
struct fade_view_data* data = NULL;
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 4fb3518..364df99 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2072,17 +2072,6 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
return IVI_SUCCEEDED;
}
-wl_fixed_t
-ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf)
-{
- if (ivisurf == NULL) {
- weston_log("ivi_layout_surface_get_opacity: invalid argument\n");
- return wl_fixed_from_double(0.0);
- }
-
- return ivisurf->prop.opacity;
-}
-
int32_t
ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y,
@@ -2726,7 +2715,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
.get_surfaces_on_layer = ivi_layout_get_surfaces_on_layer,
.surface_set_visibility = ivi_layout_surface_set_visibility,
.surface_set_opacity = ivi_layout_surface_set_opacity,
- .surface_get_opacity = ivi_layout_surface_get_opacity,
.surface_set_source_rectangle = ivi_layout_surface_set_source_rectangle,
.surface_set_destination_rectangle = ivi_layout_surface_set_destination_rectangle,
.surface_set_position = ivi_layout_surface_set_position,
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index e7bcee9..db6155b 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -375,27 +375,21 @@ RUNNER_TEST(surface_opacity)
const struct ivi_layout_interface *lyt = ctx->layout_interface;
struct ivi_layout_surface *ivisurf;
int32_t ret;
- wl_fixed_t opacity;
const struct ivi_layout_surface_properties *prop;
ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
runner_assert(ivisurf);
- runner_assert(lyt->surface_get_opacity(ivisurf) ==
- wl_fixed_from_double(1.0));
+ prop = lyt->get_properties_of_surface(ivisurf);
+ runner_assert(prop->opacity == wl_fixed_from_double(1.0));
ret = lyt->surface_set_opacity(ivisurf, wl_fixed_from_double(0.5));
runner_assert(ret == IVI_SUCCEEDED);
- runner_assert(lyt->surface_get_opacity(ivisurf) ==
- wl_fixed_from_double(1.0));
+ runner_assert(prop->opacity == wl_fixed_from_double(1.0));
lyt->commit_changes();
- opacity = lyt->surface_get_opacity(ivisurf);
- runner_assert(opacity == wl_fixed_from_double(0.5));
-
- prop = lyt->get_properties_of_surface(ivisurf);
runner_assert(prop->opacity == wl_fixed_from_double(0.5));
}
@@ -590,7 +584,7 @@ RUNNER_TEST(surface_bad_opacity)
{
const struct ivi_layout_interface *lyt = ctx->layout_interface;
struct ivi_layout_surface *ivisurf;
- wl_fixed_t opacity;
+ const struct ivi_layout_surface_properties *prop;
ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
runner_assert(ivisurf != NULL);
@@ -606,24 +600,20 @@ RUNNER_TEST(surface_bad_opacity)
lyt->commit_changes();
- opacity = lyt->surface_get_opacity(ivisurf);
- runner_assert(opacity == wl_fixed_from_double(0.3));
+ prop = lyt->get_properties_of_surface(ivisurf);
+ runner_assert(prop->opacity == wl_fixed_from_double(0.3));
runner_assert(lyt->surface_set_opacity(
ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
lyt->commit_changes();
- opacity = lyt->surface_get_opacity(ivisurf);
- runner_assert(opacity == wl_fixed_from_double(0.3));
+ runner_assert(prop->opacity == wl_fixed_from_double(0.3));
runner_assert(lyt->surface_set_opacity(
NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
lyt->commit_changes();
-
- opacity = lyt->surface_get_opacity(NULL);
- runner_assert(opacity == wl_fixed_from_double(0.0));
}
RUNNER_TEST(ivi_layout_commit_changes)
--
1.7.9.5
More information about the wayland-devel
mailing list