summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-12-06 15:22:56 +0900
committerHermet Park <hermetpark@gmail.com>2019-12-06 15:31:30 +0900
commit19ef1555268e99cfb6ab07521d81519ada251617 (patch)
treef00252ec04eee40ad2b8c83e8b6c45932c40e35a /src/lib/ector
parent562ae738ccafbe1d876cc1a90de79fe97ad3ba79 (diff)
vg ector: Call a pair of ector begin/end for ector buffer drawing.
While we render vector drawing on ector,it uses ector buffers for subsequent compositions. In this sequence, it switches ector buffer with a composition target, while resuing the global ector context. Previously, it trickly switched ector buffer, it broke the ector begin/end pair. Now, it needs to recover global ector buffer once the composition finished. Thus ector buffer need to return the current pixels information for this.
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/ector_buffer.eo10
-rw-r--r--src/lib/ector/ector_surface.eo6
-rw-r--r--src/lib/ector/software/ector_software_buffer.c11
-rw-r--r--src/lib/ector/software/ector_software_buffer_base.eo1
-rw-r--r--src/lib/ector/software/ector_software_surface.c9
-rw-r--r--src/lib/ector/software/ector_software_surface.eo2
6 files changed, 35 insertions, 4 deletions
diff --git a/src/lib/ector/ector_buffer.eo b/src/lib/ector/ector_buffer.eo
index a2e2253b73..a4a73b9b1a 100644
--- a/src/lib/ector/ector_buffer.eo
+++ b/src/lib/ector/ector_buffer.eo
@@ -81,6 +81,16 @@ mixin @beta Ector.Buffer
81 } 81 }
82 return: bool; [[True if pixels_set was successful]] 82 return: bool; [[True if pixels_set was successful]]
83 } 83 }
84 pixels_get @pure_virtual {
85 [[Gets the source pixels for the current buffer]]
86 params {
87 @out pixels: void_ptr; [[Returns buffer pixel pointer]]
88 @out width: int; [[Returns buffer width]]
89 @out height: int; [[Returns buffer height]]
90 @out stride: int; [[Returns buffer stride size]]
91 }
92 return: bool; [[True if returned pixels is writable]]
93 }
84 @property flags { 94 @property flags {
85 [[The capabilities of this buffer]] 95 [[The capabilities of this buffer]]
86 get {} 96 get {}
diff --git a/src/lib/ector/ector_surface.eo b/src/lib/ector/ector_surface.eo
index 67a4813368..7d7defd3e9 100644
--- a/src/lib/ector/ector_surface.eo
+++ b/src/lib/ector/ector_surface.eo
@@ -5,10 +5,10 @@ mixin @beta Ector.Surface extends Ector.Buffer
5 c_prefix: ector_surface; 5 c_prefix: ector_surface;
6 data: null; 6 data: null;
7 methods { 7 methods {
8 @property reference_point { 8 @property reference_point @pure_virtual {
9 [[This defines where (0,0) is in pixel coordinates inside the surface]] 9 [[This defines where (0,0) is in pixel coordinates inside the surface]]
10 set @pure_virtual { 10 set {}
11 } 11 get {}
12 values { 12 values {
13 x: int; [[X coordinate for reference point]] 13 x: int; [[X coordinate for reference point]]
14 y: int; [[Y coordinate for reference point]] 14 y: int; [[Y coordinate for reference point]]
diff --git a/src/lib/ector/software/ector_software_buffer.c b/src/lib/ector/software/ector_software_buffer.c
index df7fc27d1f..d6de02f4e7 100644
--- a/src/lib/ector/software/ector_software_buffer.c
+++ b/src/lib/ector/software/ector_software_buffer.c
@@ -64,6 +64,17 @@ _ector_software_buffer_base_pixels_clear(Eo *obj EINA_UNUSED, Ector_Software_Buf
64} 64}
65 65
66EOLIAN static Eina_Bool 66EOLIAN static Eina_Bool
67_ector_software_buffer_base_ector_buffer_pixels_get(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
68 void **pixels, int* width, int* height, int* stride)
69{
70 if (*pixels) *pixels = pd->pixels.u8;
71 if (*width) *width = pd->generic->w;
72 if (*height) *height = pd->generic->h;
73 if (*stride) *stride = pd->stride;
74 return pd->writable;
75}
76
77EOLIAN static Eina_Bool
67_ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buffer_Base_Data *pd, 78_ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
68 void *pixels, int width, int height, int stride, 79 void *pixels, int width, int height, int stride,
69 Efl_Gfx_Colorspace cspace, Eina_Bool writable) 80 Efl_Gfx_Colorspace cspace, Eina_Bool writable)
diff --git a/src/lib/ector/software/ector_software_buffer_base.eo b/src/lib/ector/software/ector_software_buffer_base.eo
index 8cb576ef0a..39ad47ccac 100644
--- a/src/lib/ector/software/ector_software_buffer_base.eo
+++ b/src/lib/ector/software/ector_software_buffer_base.eo
@@ -10,6 +10,7 @@ mixin @beta Ector.Software.Buffer.Base extends Ector.Buffer
10 implements { 10 implements {
11 Ector.Buffer.flags { get; } 11 Ector.Buffer.flags { get; }
12 Ector.Buffer.pixels_set; 12 Ector.Buffer.pixels_set;
13 Ector.Buffer.pixels_get;
13 Ector.Buffer.map; 14 Ector.Buffer.map;
14 Ector.Buffer.unmap; 15 Ector.Buffer.unmap;
15 } 16 }
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index 40dbe67e69..ba64445ba3 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -239,6 +239,15 @@ _ector_software_surface_efl_object_destructor(Eo *obj, Ector_Software_Surface_Da
239} 239}
240 240
241static void 241static void
242_ector_software_surface_ector_surface_reference_point_get(const Eo *obj EINA_UNUSED,
243 Ector_Software_Surface_Data *pd,
244 int* x, int* y)
245{
246 if (x) *x = pd->x;
247 if (y) *y = pd->y;
248}
249
250static void
242_ector_software_surface_ector_surface_reference_point_set(Eo *obj EINA_UNUSED, 251_ector_software_surface_ector_surface_reference_point_set(Eo *obj EINA_UNUSED,
243 Ector_Software_Surface_Data *pd, 252 Ector_Software_Surface_Data *pd,
244 int x, int y) 253 int x, int y)
diff --git a/src/lib/ector/software/ector_software_surface.eo b/src/lib/ector/software/ector_software_surface.eo
index 62126401b8..5836951f73 100644
--- a/src/lib/ector/software/ector_software_surface.eo
+++ b/src/lib/ector/software/ector_software_surface.eo
@@ -5,7 +5,7 @@ class @beta Ector.Software.Surface extends Ector.Software.Buffer implements Ecto
5 methods {} 5 methods {}
6 implements { 6 implements {
7 Ector.Surface.renderer_factory_new; 7 Ector.Surface.renderer_factory_new;
8 Ector.Surface.reference_point { set; } 8 Ector.Surface.reference_point { set; get; }
9 Ector.Surface.draw_image; 9 Ector.Surface.draw_image;
10 Efl.Object.destructor; 10 Efl.Object.destructor;
11 Efl.Object.constructor; 11 Efl.Object.constructor;