summaryrefslogtreecommitdiff
path: root/src/lib/evas/Evas_GL.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-09-19 17:32:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-10-20 12:16:08 +0900
commita0712e25e188d16744df8e66de72d67ab7518cda (patch)
treec5622f705711c70903c96c9f1937a8348a6ec2f0 /src/lib/evas/Evas_GL.h
parent6cd0aa17dae73dd242ce95bc23dbb13657875baa (diff)
Evas GL: Add support for pbuffer surfaces
Supports only EGL for now :( These pbuffer surfaces can be used to create dummy surfaces for make_current and render threads. @feature
Diffstat (limited to 'src/lib/evas/Evas_GL.h')
-rw-r--r--src/lib/evas/Evas_GL.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
index c061770406..a2da465496 100644
--- a/src/lib/evas/Evas_GL.h
+++ b/src/lib/evas/Evas_GL.h
@@ -391,8 +391,9 @@ typedef void *EvasGLImage;
391 */ 391 */
392typedef enum _Evas_GL_Color_Format 392typedef enum _Evas_GL_Color_Format
393{ 393{
394 EVAS_GL_RGB_888 = 0, 394 EVAS_GL_RGB_888 = 0, /**< Opaque RGB surface */
395 EVAS_GL_RGBA_8888 = 1 395 EVAS_GL_RGBA_8888 = 1, /**< RGBA surface with alpha */
396 EVAS_GL_NO_FBO = 2 /**< Special value for creating PBuffer surfaces without any attached buffer. @see evas_gl_pbuffer_surface_create. @since 1.12*/
396} Evas_GL_Color_Format; 397} Evas_GL_Color_Format;
397 398
398/** 399/**
@@ -529,10 +530,45 @@ EAPI void evas_gl_config_free (Evas_GL_Config *cfg) E
529EAPI Evas_GL_Surface *evas_gl_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2); 530EAPI Evas_GL_Surface *evas_gl_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2);
530 531
531/** 532/**
533 * @brief Create a pixel buffer surface
534 *
535 * @param[in] evas_gl The given Evas_GL object
536 * @param[in] cfg Pixel format and configuration of the pixel buffer surface
537 * @param[in] w Requested width of the buffer
538 * @param[in] h Requested height of the buffer
539 * @param[in] attrib_list An optional list of attribute-value pairs terminated by attribute 0, can be @c NULL. Currently, no attributes are supported.
540 *
541 * @return The created GL surface object,
542 * otherwise @c NULL on failure
543 *
544 * The surface must be released with @ref evas_gl_surface_destroy.
545 *
546 * If the color format in @a cfg is @ref EVAS_GL_RGB_888 or @ref EVAS_GL_RGBA_8888,
547 * then Evas will automatically generate a framebuffer attached to this PBuffer.
548 * Its properties can be queried using @ref evas_gl_native_surface_get.
549 * If you want to attach an FBO yourself, or create a PBuffer surface only,
550 * please use the color format @ref EVAS_GL_NO_FBO.
551 *
552 * Creating a 1x1 PBuffer surface can be useful in order to call
553 * @ref evas_gl_make_current() from another thread.
554 *
555 * @note The attribute list can be terminated by EVAS_GL_NONE or 0.
556 * As of now, no special attributes are supported yet. Also, only EGL
557 * is supported at the moment of writing.
558 *
559 * @see evas_gl_surface_destroy
560 *
561 * @since 1.12
562 */
563EAPI Evas_GL_Surface *evas_gl_pbuffer_surface_create(Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h, const int *attrib_list) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2);
564
565/**
532 * @brief Destroys an Evas GL Surface. 566 * @brief Destroys an Evas GL Surface.
533 * 567 *
534 * @param[in] evas_gl The given Evas_GL object 568 * @param[in] evas_gl The given Evas_GL object
535 * @param[in] surf The given GL surface object 569 * @param[in] surf The given GL surface object
570 *
571 * @note This function can also destroy pbuffer surfaces.
536 */ 572 */
537EAPI void evas_gl_surface_destroy (Evas_GL *evas_gl, Evas_GL_Surface *surf) EINA_ARG_NONNULL(1,2); 573EAPI void evas_gl_surface_destroy (Evas_GL *evas_gl, Evas_GL_Surface *surf) EINA_ARG_NONNULL(1,2);
538 574