jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1adc3cd915f9bd55337e37fb782bd1c38080478c

commit 1adc3cd915f9bd55337e37fb782bd1c38080478c
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Dec 15 19:58:43 2015 +0900

    ector: add drawable flag to buffers
    
    This indicates that a buffer can be used as a source to draw pixels.
    Can't they all do that? Well, not exactly. A CPU buffer can't be drawn
    by the GPU... not directly at least. That's what this flag is for.
---
 src/lib/ector/ector_generic_buffer.eo          | 13 +++++++------
 src/lib/ector/software/ector_software_buffer.c |  7 +++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/lib/ector/ector_generic_buffer.eo 
b/src/lib/ector/ector_generic_buffer.eo
index ae9a87c..a196829 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 f96d05a..376228f 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 |

-- 


Reply via email to