ivi-shell: remove ivi_layout_surface_get_opacity API
authorUcan, Emre \(ADITG/SW1\) <eucan@de.adit-jv.com>
Fri, 4 Mar 2016 12:50:12 +0000 (12:50 +0000)
committerBryce Harrington <bryce@osg.samsung.com>
Fri, 4 Mar 2016 18:33:34 +0000 (10:33 -0800)
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
ivi-shell/ivi-layout-export.h
ivi-shell/ivi-layout-private.h
ivi-shell/ivi-layout-transition.c
ivi-shell/ivi-layout.c
tests/ivi_layout-test-plugin.c

index fc0e050..c6dc09b 100644 (file)
@@ -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
index 342ef4a..0d126dd 100644 (file)
@@ -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);
index fd8ce85..3c994a4 100644 (file)
@@ -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;
 
index 2b33796..dfed085 100644 (file)
@@ -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,
@@ -2724,7 +2713,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,
index e7bcee9..db6155b 100644 (file)
@@ -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)