enlightenment_info : add frender to force update screen 56/119056/2
authorJuyeon Lee <juyeonne.lee@samsung.com>
Wed, 15 Mar 2017 09:00:24 +0000 (18:00 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Wed, 15 Mar 2017 09:07:22 +0000 (18:07 +0900)
all      : updates client's surface and canvas
cls      : updates client's surface only
canvas   : updates canvas adding damage in fullscreen size

Change-Id: I0eba72bfaf3a5c9f6dfdeab0cdfec25ac39ced53

src/bin/e_info_client.c
src/bin/e_info_server.c
src/bin/e_info_shared_types.h

index b3919c7a64e11ee72362519b600eb1cb9ad87faa..931608544d71cf119bec4bed30093de94da9bd08 100644 (file)
@@ -2397,6 +2397,42 @@ arg_err:
    printf("Usage: enlightenment_info -scrsaver %s", USAGE_SCRSAVER);
 }
 
+static void
+_e_info_client_proc_force_render(int argc, char **argv)
+{
+   E_Info_Cmd_Force_Render cmd = E_INFO_CMD_FRENDER_NONE;
+   Eina_Bool res;
+
+   if (eina_streq(argv[2], "all"))
+     {
+        if (argc != 3) goto arg_err;
+        cmd = E_INFO_CMD_FRENDER_ALL;
+     }
+   else if (eina_streq(argv[2], "cls"))
+     {
+        if (argc != 3) goto arg_err;
+        cmd = E_INFO_CMD_FRENDER_CLS;
+     }
+   else if (eina_streq(argv[2], "canvas"))
+     {
+        if (argc != 3) goto arg_err;
+        cmd = E_INFO_CMD_FRENDER_CANVAS;
+     }
+   else
+     goto arg_err;
+
+   res = _e_info_client_eldbus_message_with_args("frender",
+                                                 NULL,
+                                                 "i",
+                                                 cmd);
+   EINA_SAFETY_ON_FALSE_RETURN(res);
+   return;
+
+arg_err:
+   printf("Usage: enlightenment_info -frender %s", USAGE_FORCE_RENDER);
+
+}
+
 static struct
 {
    const char *option;
@@ -2577,6 +2613,12 @@ static struct
       NULL,
       "current desktop",
       _e_info_client_proc_desk
+   },
+   {
+      "frender",
+      USAGE_FORCE_RENDER,
+      "force render according to parameters",
+      _e_info_client_proc_force_render
    }
 };
 
index 78f8ca3e91de33db1bd2c64215b1e42db93c6ea6..e6721a1e9d82cd2738308ab83038c6bc646e6d84 100644 (file)
@@ -2794,6 +2794,62 @@ e_info_server_cb_aux_message(const Eldbus_Service_Interface *iface EINA_UNUSED,
    return reply;
 }
 
+static Eldbus_Message *
+_e_info_server_cb_force_render(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   E_Info_Cmd_Force_Render cmd;
+   Eina_Bool res;
+   char result[1024];
+   E_Client *ec = NULL;
+
+   res = eldbus_message_arguments_get(msg,
+                                      "i",
+                                      &cmd);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, reply);
+
+   switch (cmd)
+     {
+      case E_INFO_CMD_FRENDER_ALL:
+         E_CLIENT_FOREACH(ec)
+           {
+              if (ec->visible && (!ec->input_only))
+                e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+           }
+         evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
+         e_comp_render_queue();
+         snprintf(result, sizeof(result),
+                  "[Server] force rendered all clients and canvas\n");
+         break;
+      case E_INFO_CMD_FRENDER_CLS:
+         E_CLIENT_FOREACH(ec)
+           {
+              if (ec->visible && (!ec->input_only))
+                e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+           }
+         e_comp_render_queue();
+         snprintf(result, sizeof(result),
+                  "[Server] updated clients' surface");
+         break;
+      case E_INFO_CMD_FRENDER_CANVAS:
+         evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
+         snprintf(result, sizeof(result),
+                  "[Server] updated canvas");
+         break;
+      default:
+         snprintf(result, sizeof(result),
+                  "[Server] Error Unknown cmd(%d) for the render force",
+                  cmd);
+         break;
+     }
+
+   eldbus_message_arguments_append(reply,
+                                   "s",
+                                   result);
+
+   return reply;
+}
+
 static const Eldbus_Method methods[] = {
    { "get_window_info", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
    { "compobjs", NULL, ELDBUS_ARGS({"a("SIGNATURE_COMPOBJS_CLIENT")", "array of comp objs"}), _e_info_server_cb_compobjs, 0 },
@@ -2832,6 +2888,7 @@ static const Eldbus_Method methods[] = {
    { "slot_message", ELDBUS_ARGS({"iiiiii", "slot_message"}), ELDBUS_ARGS({"a(ss)", "array of ec"}), e_info_server_cb_slot_message, 0},
    { "desktop_geometry_set", ELDBUS_ARGS({"iiii", "Geometry"}), NULL, _e_info_server_cb_desktop_geometry_set, 0},
    { "desk_zoom", ELDBUS_ARGS({"ddii", "Zoom"}), NULL, _e_info_server_cb_desk_zoom, 0},
+   { "frender", ELDBUS_ARGS({"i", "frender"}), ELDBUS_ARGS({"s", "force_render_result"}), _e_info_server_cb_force_render, 0},
    { NULL, NULL, NULL, NULL, 0 }
 };
 
index 7741cb10681b0f106b2b291423b45ac41b438fc5..b2089c0ecdc965da60ee0c3aa2f0bcb8ee68b3b4 100644 (file)
@@ -155,6 +155,25 @@ typedef enum
    E_INFO_CMD_MESSAGE_START,
 } E_Info_Slot_Message;
 
+#define USAGE_FORCE_RENDER                                            \
+   "(all | cls | canvas)\n"                                           \
+   "Commands:\n"                                                      \
+   "\tall      : updates client's surface and canvas \n"              \
+   "\tcls      : updates client's surface only\n"                     \
+   "\tcanvas   : updates canvas adding damage in fullscreen size\n"   \
+   "Example:\n"                                                       \
+   "\tenlightenment_info -frender all\n"                              \
+   "\tenlightenment_info -frender cls\n"                              \
+   "\tenlightenment_info -frender canvas\n"
+
+typedef enum
+{
+   E_INFO_CMD_FRENDER_NONE,
+   E_INFO_CMD_FRENDER_ALL,
+   E_INFO_CMD_FRENDER_CLS,
+   E_INFO_CMD_FRENDER_CANVAS,
+} E_Info_Cmd_Force_Render;
+
 /* -------------------------------------------------------------------------- */
 /* SUBSURFACE                                                                 */
 /* -------------------------------------------------------------------------- */