summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-09-19 13:10:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-10-20 12:16:43 +0900
commit0799bb1f8db164e6bfa934bedd862ff1dd98fed4 (patch)
treec14ea285a81b3af93472f3a2e68b2ea5367e46b4
parent08f7073a98d41361c0b3d9ad88314500a6a10bb3 (diff)
GLView: Add support for client-side rotation
See recent changes in Evas GL for reference. This also introduces the EO function rotation_get() @feature
-rw-r--r--src/lib/elm_glview.c12
-rw-r--r--src/lib/elm_glview.eo22
-rw-r--r--src/lib/elm_glview_common.h15
3 files changed, 48 insertions, 1 deletions
diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c
index 7d2a236f9..97e2dfcdf 100644
--- a/src/lib/elm_glview.c
+++ b/src/lib/elm_glview.c
@@ -355,6 +355,12 @@ _elm_glview_mode_set(Eo *obj, Elm_Glview_Data *sd, Elm_GLView_Mode mode)
355 if (mode & ELM_GLVIEW_CLIENT_SIDE_ROTATION) 355 if (mode & ELM_GLVIEW_CLIENT_SIDE_ROTATION)
356 sd->config->options_bits |= EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION; 356 sd->config->options_bits |= EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION;
357 357
358 // Check for Alpha Channel and enable it
359 if (mode & ELM_GLVIEW_ALPHA)
360 evas_object_image_alpha_set(wd->resize_obj, EINA_TRUE);
361 else
362 evas_object_image_alpha_set(wd->resize_obj, EINA_FALSE);
363
358 sd->mode = mode; 364 sd->mode = mode;
359 365
360 _glview_update_surface(obj); 366 _glview_update_surface(obj);
@@ -466,6 +472,12 @@ _elm_glview_evas_gl_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
466 return sd->evasgl; 472 return sd->evasgl;
467} 473}
468 474
475EOLIAN static int
476_elm_glview_rotation_get(Eo *obj EINA_UNUSED, Elm_Glview_Data *sd)
477{
478 return evas_gl_rotation_get(sd->evasgl);
479}
480
469static void 481static void
470_elm_glview_class_constructor(Eo_Class *klass) 482_elm_glview_class_constructor(Eo_Class *klass)
471{ 483{
diff --git a/src/lib/elm_glview.eo b/src/lib/elm_glview.eo
index cbd065379..839cb669a 100644
--- a/src/lib/elm_glview.eo
+++ b/src/lib/elm_glview.eo
@@ -176,9 +176,31 @@ class Elm_Glview (Elm_Widget)
176 @return The Evas_GL used by this GLView. 176 @return The Evas_GL used by this GLView.
177 177
178 @ingroup GLView */ 178 @ingroup GLView */
179 legacy: null;
179 return: Evas_GL *; 180 return: Evas_GL *;
180 } 181 }
181 } 182 }
183 rotation {
184 get {
185 /*@
186 Get the current GL view's rotation when using direct rendering
187
188 @return A window rotation in degrees (0, 90, 180 or 270)
189
190 @note This rotation can be different from the device orientation. This
191 rotation value must be used in case of direct rendering and should be
192 taken into account by the application when setting the internal rotation
193 matrix for the view.
194
195 @see ELM_GLVIEW_CLIENT_SIDE_ROTATION
196
197 @since 1.12
198
199 @ingroup GLView */
200 legacy: null;
201 return: int;
202 }
203 }
182 } 204 }
183 implements { 205 implements {
184 class.constructor; 206 class.constructor;
diff --git a/src/lib/elm_glview_common.h b/src/lib/elm_glview_common.h
index 7e6dc9663..6df9f61e1 100644
--- a/src/lib/elm_glview_common.h
+++ b/src/lib/elm_glview_common.h
@@ -1,8 +1,21 @@
1typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj); 1typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj);
2 2
3/** 3/**
4 * Defines mode of GLView 4 * @brief Selects the target surface properties
5 * 5 *
6 * An OR combination of @c Elm_GLView_Mode values should be passed to
7 * @ref elm_glview_mode_set when setting up a GL widget. These flags will
8 * specify the properties of the rendering target surface; in particular,
9 * the mode can request the surface to support alpha, depth and stencil buffers.
10 *
11 * @note @c ELM_GLVIEW_CLIENT_SIDE_ROTATION is a special value that indicates
12 * to EFL that the application will handle the view rotation when the
13 * device is rotated. This is needed only when the application requests
14 * direct rendering. Please refer to @ref Evas_GL
15 * for more information about direct rendering.
16 *
17 * @see elm_glview_mode_set
18 * @see @ref elm_opengl_page
6 * @ingroup GLView 19 * @ingroup GLView
7 */ 20 */
8typedef enum _Elm_GLView_Mode 21typedef enum _Elm_GLView_Mode