diff --git a/src/lib/ector/ector_generic_buffer.eo b/src/lib/ector/ector_generic_buffer.eo index ae9a87c0ee..a196829c1c 100644 --- a/src/lib/ector/ector_generic_buffer.eo +++ b/src/lib/ector/ector_generic_buffer.eo @@ -1,12 +1,13 @@ enum Ector.Buffer.Flag { - none = 0x00, [[Buffer may not have any backing]] + none = 0x00, [[Buffer may not have any backing, indicates an invalid buffer.]] cpu_readable = 0x01, [[Can be read from the CPU after map. Reading may still be very slow.]] cpu_writable = 0x02, [[Can be written to by the CPU after map. Writing may still be very slow.]] - renderable = 0x04, [[Can be rendered to, ie CPU memory for SW rendering, or an FBO for GL engine]] - cpu_readable_fast = 0x08, [[Can be read by the CPU at high speed, ie no need for glReadPixels]] - cpu_writable_fast = 0x0A, [[Can be written by the CPU at high speed, ie no need for GPU texture upload]] - uncached = 0x10, [[Backed by uncached memory, ie. slow-ish reads but faster than glReadPixels]] -/* non_coherent = 0x20, [[Memory may be mapped but will not be coherent between GPU and CPU. Call flush or invalidate to synchronize it.]] */ + renderable = 0x04, [[Can be rendered to, ie CPU memory for SW rendering, or an FBO for GL engine.]] + drawable = 0x08, [[Can be used as a source of pixels to draw on Evas.]] + cpu_readable_fast = 0x10, [[Can be read by the CPU at high speed, ie no need for glReadPixels.]] + cpu_writable_fast = 0x20, [[Can be written by the CPU at high speed, ie no need for GPU texture upload.]] + uncached = 0x40, [[Backed by uncached memory, ie. slow-ish reads but faster than glReadPixels.]] +/* non_coherent = 0x80, [[Memory may be mapped but will not be coherent between GPU and CPU. Call flush or invalidate to synchronize it.]] */ } enum Ector.Buffer.Access_Flag { diff --git a/src/lib/ector/software/ector_software_buffer.c b/src/lib/ector/software/ector_software_buffer.c index f96d05ad17..376228f5c8 100644 --- a/src/lib/ector/software/ector_software_buffer.c +++ b/src/lib/ector/software/ector_software_buffer.c @@ -63,6 +63,12 @@ _ector_software_buffer_base_pixels_clear(Eo *obj, Ector_Software_Buffer_Base_Dat if (!pd->pixels.u8) return; + if (pd->internal.maps) + { + CRI("Can not call pixels_clear when the buffer is mapped."); + return; + } + eo_do(obj, eo_event_callback_call(ECTOR_GENERIC_BUFFER_EVENT_DETACHED, pd->pixels.u8)); if (!pd->nofree) { @@ -320,6 +326,7 @@ EOLIAN static Ector_Buffer_Flag _ector_software_buffer_base_ector_generic_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd) { return ECTOR_BUFFER_FLAG_CPU_READABLE | + ECTOR_BUFFER_FLAG_DRAWABLE | ECTOR_BUFFER_FLAG_CPU_READABLE_FAST | ECTOR_BUFFER_FLAG_RENDERABLE | (pd->writable ? (ECTOR_BUFFER_FLAG_CPU_WRITABLE |