2003-09-04 00:40:34 -07:00
|
|
|
#ifndef EVAS_GL_COMMON_H
|
|
|
|
#define EVAS_GL_COMMON_H
|
|
|
|
|
2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2006-08-19 04:58:07 -07:00
|
|
|
#include "evas_private.h"
|
2003-09-04 00:40:34 -07:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <unistd.h>
|
From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] Evas gl shader use binary shader
I make patch related with evas gl binary shader.
The concept of binary shader is compile shader only once.
Some people want to use binary shader because of performance issue.
In current evas gl engine, every application have to compile shader each
time.
But I modify code , so only first running application need compile shader.
Other application use already compiled shader(binary shader)
The binary shader is made under HOME/.evas/gl_common_shaders directory.
Binary shader is created according to GL vendor,GL renderer, GL version and
Module_arch.
The basic flow is
1. First running application which use gl engine check binary shader
directory, but it can't find binary shader.
2. After compiling shader, It saves compiled shaders..
3. Other application checks shader directory, it can use binary
shaders.
In mobile target, using binary shader, I can save 150ms. (that time, there
is 11 shaders).
If there is more shaders and more applications, this flow maybe save more
total time.
(the above is now in, changelog coming, with change to using ~/.cache,
some formatting fixes, make ity do the desktop gl one right with the
retrievable hint parameter ont he program etc. - doesn't break desktop
gl at least. yay. a,so fixes to mke it compile at all).
SVN revision: 59167
2011-05-03 23:15:00 -07:00
|
|
|
#include <Eet.h>
|
2003-09-04 00:40:34 -07:00
|
|
|
|
2011-04-05 06:19:20 -07:00
|
|
|
#define GL_GLEXT_PROTOTYPES
|
2008-11-01 02:46:51 -07:00
|
|
|
|
2015-07-23 00:24:29 -07:00
|
|
|
#if !defined(HAVE_ECORE_X_XLIB) && !defined(MESA_EGL_NO_X11_HEADERS)
|
|
|
|
# define MESA_EGL_NO_X11_HEADERS
|
|
|
|
#endif
|
|
|
|
|
2012-01-07 23:21:35 -08:00
|
|
|
#ifdef BUILD_ENGINE_GL_COCOA
|
2009-03-02 22:07:08 -08:00
|
|
|
# include <OpenGL/gl.h>
|
2009-11-21 02:51:51 -08:00
|
|
|
# include <OpenGL/glext.h>
|
2008-09-19 19:03:22 -07:00
|
|
|
#else
|
2010-01-28 22:12:35 -08:00
|
|
|
# ifdef _EVAS_ENGINE_SDL_H
|
2012-09-23 20:33:43 -07:00
|
|
|
# ifdef GL_GLES
|
2015-08-05 21:40:43 -07:00
|
|
|
# include <SDL2/SDL_opengles.h>
|
2010-01-31 20:55:03 -08:00
|
|
|
# else
|
2015-08-05 21:40:43 -07:00
|
|
|
# include <SDL2/SDL_opengl.h>
|
2010-01-31 20:55:03 -08:00
|
|
|
# endif
|
2009-10-09 05:10:27 -07:00
|
|
|
# else
|
2012-09-23 20:33:43 -07:00
|
|
|
# ifdef GL_GLES
|
|
|
|
# include <GLES2/gl2.h>
|
|
|
|
# include <GLES2/gl2ext.h>
|
2010-01-28 22:12:35 -08:00
|
|
|
# else
|
2011-12-17 21:03:24 -08:00
|
|
|
# include <GL/gl.h>
|
|
|
|
# include <GL/glext.h>
|
2010-01-28 22:12:35 -08:00
|
|
|
# endif
|
2009-10-09 05:10:27 -07:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GL_TEXTURE_RECTANGLE_NV
|
2010-08-11 23:02:15 -07:00
|
|
|
# define GL_TEXTURE_RECTANGLE_NV 0x84F5
|
2009-10-09 05:10:27 -07:00
|
|
|
#endif
|
2010-02-17 23:10:28 -08:00
|
|
|
#ifndef GL_BGRA
|
2010-08-11 23:02:15 -07:00
|
|
|
# define GL_BGRA 0x80E1
|
|
|
|
#endif
|
2013-11-26 20:45:50 -08:00
|
|
|
#ifndef GL_RGBA4
|
|
|
|
# define GL_RGBA4 0x8056
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGBA8
|
|
|
|
# define GL_RGBA8 0x8058
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGBA12
|
|
|
|
# define GL_RGBA12 0x805A
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGBA16
|
|
|
|
# define GL_RGBA16 0x805B
|
|
|
|
#endif
|
2014-01-12 14:02:24 -08:00
|
|
|
#ifndef GL_R3_G3_B2
|
|
|
|
# define GL_R3_G3_B2 0x2A10
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB4
|
|
|
|
# define GL_RGB4 0x804F
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB5
|
|
|
|
# define GL_RGB5 0x8050
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB8
|
|
|
|
# define GL_RGB8 0x8051
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB10
|
|
|
|
# define GL_RGB10 0x8052
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB12
|
|
|
|
# define GL_RGB12 0x8053
|
|
|
|
#endif
|
|
|
|
#ifndef GL_RGB16
|
|
|
|
# define GL_RGB16 0x8054
|
|
|
|
#endif
|
2013-11-26 20:45:50 -08:00
|
|
|
#ifndef GL_ALPHA4
|
|
|
|
# define GL_ALPHA4 0x803B
|
|
|
|
#endif
|
|
|
|
#ifndef GL_ALPHA8
|
|
|
|
# define GL_ALPHA8 0x803C
|
|
|
|
#endif
|
|
|
|
#ifndef GL_ALPHA12
|
|
|
|
# define GL_ALPHA12 0x803D
|
|
|
|
#endif
|
|
|
|
#ifndef GL_ALPHA16
|
|
|
|
# define GL_ALPHA16 0x803E
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE4
|
|
|
|
# define GL_LUMINANCE4 0x803F
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE8
|
|
|
|
# define GL_LUMINANCE8 0x8040
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE12
|
|
|
|
# define GL_LUMINANCE12 0x8041
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE16
|
|
|
|
# define GL_LUMINANCE16 0x8042
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE4_ALPHA4
|
|
|
|
# define GL_LUMINANCE4_ALPHA4 0x8043
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE8_ALPHA8
|
|
|
|
# define GL_LUMINANCE8_ALPHA8 0x8045
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE12_ALPHA12
|
|
|
|
# define GL_LUMINANCE12_ALPHA12 0x8047
|
|
|
|
#endif
|
|
|
|
#ifndef GL_LUMINANCE16_ALPHA16
|
|
|
|
# define GL_LUMINANCE16_ALPHA16 0x8048
|
|
|
|
#endif
|
2014-03-26 21:12:12 -07:00
|
|
|
#ifndef GL_ETC1_RGB8_OES
|
|
|
|
# define GL_ETC1_RGB8_OES 0x8D64
|
|
|
|
#endif
|
2014-04-24 22:51:42 -07:00
|
|
|
#ifndef GL_COMPRESSED_RGB8_ETC2
|
|
|
|
# define GL_COMPRESSED_RGB8_ETC2 0x9274
|
|
|
|
#endif
|
|
|
|
#ifndef GL_COMPRESSED_RGBA8_ETC2_EAC
|
|
|
|
# define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
|
|
|
|
#endif
|
2014-06-29 23:10:07 -07:00
|
|
|
#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
|
|
|
|
# define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
|
|
|
#endif
|
|
|
|
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
|
|
|
|
# define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
|
|
|
#endif
|
|
|
|
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
|
|
|
|
# define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
|
|
|
#endif
|
|
|
|
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
|
|
|
|
# define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
|
|
|
#endif
|
2015-01-18 19:28:32 -08:00
|
|
|
#ifndef GL_TEXTURE_EXTERNAL_OES
|
|
|
|
# define GL_TEXTURE_EXTERNAL_OES 0x8D65
|
|
|
|
#endif
|
2013-03-21 19:33:57 -07:00
|
|
|
#ifndef GL_UNPACK_ROW_LENGTH
|
2015-03-04 22:57:14 -08:00
|
|
|
# define GL_UNPACK_ROW_LENGTH 0x0CF2
|
2013-03-14 21:05:39 -07:00
|
|
|
#endif
|
2015-03-09 04:41:58 -07:00
|
|
|
#ifndef EGL_NO_DISPLAY
|
|
|
|
# define EGL_NO_DISPLAY 0
|
|
|
|
#endif
|
2010-08-13 03:34:51 -07:00
|
|
|
#ifndef EGL_NO_CONTEXT
|
|
|
|
# define EGL_NO_CONTEXT 0
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_NONE
|
|
|
|
# define EGL_NONE 0x3038
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_TRUE
|
|
|
|
# define EGL_TRUE 1
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_FALSE
|
|
|
|
# define EGL_FALSE 0
|
|
|
|
#endif
|
|
|
|
|
2010-08-11 23:02:15 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_2D_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_2D_SEC 0x3201
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_HEIGHT_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_HEIGHT_SEC 0x3202
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_WIDTH_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_WIDTH_SEC 0x3203
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_FORMAT_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_FORMAT_SEC 0x3204
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_RGB_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_RGB_SEC 0x3205
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_RGBA_SEC
|
|
|
|
# define EGL_MAP_GL_TEXTURE_RGBA_SEC 0x3206
|
|
|
|
#endif
|
2011-10-10 03:08:29 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_BGRA_SEC
|
2011-10-10 18:51:49 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_BGRA_SEC 0x3207
|
2011-10-10 03:08:29 -07:00
|
|
|
#endif
|
2011-09-30 08:51:32 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
|
2011-10-10 03:08:29 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_LUMINANCE_SEC 0x3208
|
2011-09-30 08:51:32 -07:00
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
|
2011-10-10 03:08:29 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC 0x3209
|
2011-09-30 08:51:32 -07:00
|
|
|
#endif
|
2010-08-11 23:02:15 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC
|
2011-10-10 03:08:29 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC 0x320a
|
2010-08-11 23:02:15 -07:00
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC
|
2011-10-10 03:08:29 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC 0x320b
|
2010-08-11 23:02:15 -07:00
|
|
|
#endif
|
2010-08-13 03:34:51 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC
|
2011-10-10 03:08:29 -07:00
|
|
|
# define EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC 0x320c
|
2010-02-17 23:10:28 -08:00
|
|
|
#endif
|
2015-03-01 21:40:12 -08:00
|
|
|
#ifndef EGL_IMAGE_PRESERVED_KHR
|
|
|
|
# define EGL_IMAGE_PRESERVED_KHR 0x30D2
|
|
|
|
#endif
|
2015-01-18 19:28:32 -08:00
|
|
|
#ifndef EGL_NATIVE_SURFACE_TIZEN
|
|
|
|
#define EGL_NATIVE_SURFACE_TIZEN 0x32A1
|
|
|
|
#endif
|
From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] Evas gl shader use binary shader
I make patch related with evas gl binary shader.
The concept of binary shader is compile shader only once.
Some people want to use binary shader because of performance issue.
In current evas gl engine, every application have to compile shader each
time.
But I modify code , so only first running application need compile shader.
Other application use already compiled shader(binary shader)
The binary shader is made under HOME/.evas/gl_common_shaders directory.
Binary shader is created according to GL vendor,GL renderer, GL version and
Module_arch.
The basic flow is
1. First running application which use gl engine check binary shader
directory, but it can't find binary shader.
2. After compiling shader, It saves compiled shaders..
3. Other application checks shader directory, it can use binary
shaders.
In mobile target, using binary shader, I can save 150ms. (that time, there
is 11 shaders).
If there is more shaders and more applications, this flow maybe save more
total time.
(the above is now in, changelog coming, with change to using ~/.cache,
some formatting fixes, make ity do the desktop gl one right with the
retrievable hint parameter ont he program etc. - doesn't break desktop
gl at least. yay. a,so fixes to mke it compile at all).
SVN revision: 59167
2011-05-03 23:15:00 -07:00
|
|
|
#ifndef GL_PROGRAM_BINARY_LENGTH
|
|
|
|
# define GL_PROGRAM_BINARY_LENGTH 0x8741
|
|
|
|
#endif
|
|
|
|
#ifndef GL_NUM_PROGRAM_BINARY_FORMATS
|
|
|
|
# define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
|
|
|
|
#endif
|
|
|
|
#ifndef GL_PROGRAM_BINARY_FORMATS
|
|
|
|
# define GL_PROGRAM_BINARY_FORMATS 0x87FF
|
|
|
|
#endif
|
|
|
|
#ifndef GL_PROGRAM_BINARY_RETRIEVABLE_HINT
|
|
|
|
# define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
|
|
|
|
#endif
|
2012-05-30 18:16:53 -07:00
|
|
|
#ifndef GL_MAX_SAMPLES_IMG
|
|
|
|
#define GL_MAX_SAMPLES_IMG 0x9135
|
|
|
|
#endif
|
2014-06-10 03:20:16 -07:00
|
|
|
#ifndef GL_MAX_SAMPLES_EXT
|
|
|
|
#define GL_MAX_SAMPLES_EXT 0x8D57
|
|
|
|
#endif
|
2012-09-14 00:27:49 -07:00
|
|
|
#ifndef GL_WRITE_ONLY
|
|
|
|
#define GL_WRITE_ONLY 0x88B9
|
|
|
|
#endif
|
2013-04-12 01:34:13 -07:00
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC
|
|
|
|
#define EGL_MAP_GL_TEXTURE_DEVICE_CPU_SEC 1
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_DEVICE_G2D_SEC
|
|
|
|
#define EGL_MAP_GL_TEXTURE_DEVICE_G2D_SEC 2
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_OPTION_READ_SEC
|
|
|
|
#define EGL_MAP_GL_TEXTURE_OPTION_READ_SEC (1<<0)
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC
|
|
|
|
#define EGL_MAP_GL_TEXTURE_OPTION_WRITE_SEC (1<<1)
|
|
|
|
#endif
|
2015-03-13 00:31:54 -07:00
|
|
|
#ifndef EGL_GL_TEXTURE_2D_KHR
|
|
|
|
#define EGL_GL_TEXTURE_2D_KHR 0x30B1
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_GL_TEXTURE_LEVEL_KHR
|
|
|
|
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC
|
|
|
|
#endif
|
|
|
|
#ifndef EGL_IMAGE_PRESERVED_KHR
|
|
|
|
#define EGL_IMAGE_PRESERVED_KHR 0x30D2
|
|
|
|
#endif
|
2015-05-26 00:17:50 -07:00
|
|
|
#ifndef EGL_OPENGL_ES3_BIT_KHR
|
|
|
|
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
|
|
|
|
#endif
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2014-04-25 07:46:46 -07:00
|
|
|
// Evas_3d require GL_BGR, but that's an extention and will not be necessary once we move to Evas_GL_Image
|
|
|
|
#ifndef GL_BGR
|
|
|
|
#define GL_BGR 0x80E0
|
|
|
|
#endif
|
|
|
|
|
2013-06-11 02:12:07 -07:00
|
|
|
#ifndef GL_COLOR_BUFFER_BIT0_QCOM
|
|
|
|
// if GL_COLOR_BUFFER_BIT0_QCOM just assume the rest arent... saves fluff
|
|
|
|
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
|
|
|
|
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
|
|
|
|
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
|
|
|
|
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
|
|
|
|
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
|
|
|
|
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
|
|
|
|
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
|
|
|
|
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
|
|
|
|
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
|
|
|
|
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
|
|
|
|
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
|
|
|
|
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
|
|
|
|
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
|
|
|
|
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
|
|
|
|
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
|
|
|
|
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
|
|
|
|
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
|
|
|
|
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
|
|
|
|
#endif
|
|
|
|
|
2013-06-23 19:41:32 -07:00
|
|
|
#define EVAS_GL_TILE_SIZE 16
|
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
#define SHAD_VERTEX 0
|
|
|
|
#define SHAD_COLOR 1
|
|
|
|
#define SHAD_TEXUV 2
|
2009-10-10 06:24:15 -07:00
|
|
|
#define SHAD_TEXUV2 3
|
|
|
|
#define SHAD_TEXUV3 4
|
2014-07-10 20:17:46 -07:00
|
|
|
#define SHAD_TEXA 5
|
2015-02-11 21:56:03 -08:00
|
|
|
#define SHAD_TEXSAM 6
|
2015-03-31 02:58:51 -07:00
|
|
|
#define SHAD_MASK 7
|
2015-09-07 03:21:13 -07:00
|
|
|
#define SHAD_MASKSAM 8
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2013-06-12 03:37:44 -07:00
|
|
|
typedef struct _Evas_GL_Program Evas_GL_Program;
|
|
|
|
typedef struct _Evas_GL_Program_Source Evas_GL_Program_Source;
|
|
|
|
typedef struct _Evas_GL_Shared Evas_GL_Shared;
|
|
|
|
typedef struct _Evas_Engine_GL_Context Evas_Engine_GL_Context;
|
|
|
|
typedef struct _Evas_GL_Texture_Pool Evas_GL_Texture_Pool;
|
|
|
|
typedef struct _Evas_GL_Texture_Alloca Evas_GL_Texture_Alloca;
|
|
|
|
typedef struct _Evas_GL_Texture Evas_GL_Texture;
|
|
|
|
typedef struct _Evas_GL_Image Evas_GL_Image;
|
|
|
|
typedef struct _Evas_GL_Font_Texture Evas_GL_Font_Texture;
|
|
|
|
typedef struct _Evas_GL_Polygon Evas_GL_Polygon;
|
|
|
|
typedef struct _Evas_GL_Polygon_Point Evas_GL_Polygon_Point;
|
2013-06-23 19:41:32 -07:00
|
|
|
typedef struct _Evas_GL_Texture_Async_Preload Evas_GL_Texture_Async_Preload;
|
|
|
|
|
|
|
|
typedef Eina_Bool (*evas_gl_make_current_cb)(void *engine_data, void *doit);
|
2003-09-08 22:51:03 -07:00
|
|
|
|
2014-11-13 16:41:15 -08:00
|
|
|
/* enum Evas_GL_Shader is defined below */
|
|
|
|
#include "shader/evas_gl_enum.x"
|
2011-08-24 09:20:15 -07:00
|
|
|
|
2015-04-28 05:24:11 -07:00
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# ifdef EFL_EVAS_BUILD
|
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif /* ! DLL_EXPORT */
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
|
|
|
# endif /* ! EFL_EVAS_BUILD */
|
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif /* ! _WIN32 */
|
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct _Evas_GL_Program
|
2003-09-04 00:40:34 -07:00
|
|
|
{
|
2009-10-09 05:10:27 -07:00
|
|
|
GLuint vert, frag, prog;
|
2011-08-24 09:20:15 -07:00
|
|
|
|
|
|
|
int tex_count;
|
2015-05-26 17:11:23 -07:00
|
|
|
Eina_Bool reset;
|
2009-10-09 05:10:27 -07:00
|
|
|
};
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct _Evas_GL_Program_Source
|
|
|
|
{
|
|
|
|
const char *src;
|
|
|
|
const unsigned int *bin;
|
|
|
|
int bin_size;
|
|
|
|
};
|
2003-09-04 00:40:34 -07:00
|
|
|
|
2009-10-13 02:40:39 -07:00
|
|
|
struct _Evas_GL_Shared
|
|
|
|
{
|
|
|
|
Eina_List *images;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2011-02-08 03:41:38 -08:00
|
|
|
int images_size;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2009-10-13 02:40:39 -07:00
|
|
|
struct {
|
|
|
|
GLint max_texture_units;
|
|
|
|
GLint max_texture_size;
|
2010-09-06 06:36:32 -07:00
|
|
|
GLint max_vertex_elements;
|
2010-02-16 23:26:44 -08:00
|
|
|
GLfloat anisotropic;
|
2010-02-17 23:10:28 -08:00
|
|
|
Eina_Bool rgb : 1;
|
|
|
|
Eina_Bool bgra : 1;
|
2009-10-13 02:40:39 -07:00
|
|
|
Eina_Bool tex_npo2 : 1;
|
|
|
|
Eina_Bool tex_rect : 1;
|
2010-08-11 23:02:15 -07:00
|
|
|
Eina_Bool sec_image_map : 1;
|
2015-03-01 21:40:12 -08:00
|
|
|
Eina_Bool sec_tbm_surface : 1;
|
From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] Evas gl shader use binary shader
I make patch related with evas gl binary shader.
The concept of binary shader is compile shader only once.
Some people want to use binary shader because of performance issue.
In current evas gl engine, every application have to compile shader each
time.
But I modify code , so only first running application need compile shader.
Other application use already compiled shader(binary shader)
The binary shader is made under HOME/.evas/gl_common_shaders directory.
Binary shader is created according to GL vendor,GL renderer, GL version and
Module_arch.
The basic flow is
1. First running application which use gl engine check binary shader
directory, but it can't find binary shader.
2. After compiling shader, It saves compiled shaders..
3. Other application checks shader directory, it can use binary
shaders.
In mobile target, using binary shader, I can save 150ms. (that time, there
is 11 shaders).
If there is more shaders and more applications, this flow maybe save more
total time.
(the above is now in, changelog coming, with change to using ~/.cache,
some formatting fixes, make ity do the desktop gl one right with the
retrievable hint parameter ont he program etc. - doesn't break desktop
gl at least. yay. a,so fixes to mke it compile at all).
SVN revision: 59167
2011-05-03 23:15:00 -07:00
|
|
|
Eina_Bool bin_program : 1;
|
2013-03-14 21:05:39 -07:00
|
|
|
Eina_Bool unpack_row_length : 1;
|
2014-03-26 21:12:12 -07:00
|
|
|
Eina_Bool etc1 : 1;
|
2014-04-24 22:51:42 -07:00
|
|
|
Eina_Bool etc2 : 1;
|
2014-06-11 22:44:28 -07:00
|
|
|
Eina_Bool etc1_subimage : 1;
|
2014-06-29 23:10:07 -07:00
|
|
|
Eina_Bool s3tc : 1;
|
2010-08-01 23:46:38 -07:00
|
|
|
// tuning params - per gpu/cpu combo?
|
2015-09-23 22:06:40 -07:00
|
|
|
#define DEF_CUTOUT 4096
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
#define MAX_PIPES 128
|
2010-09-30 16:20:26 -07:00
|
|
|
#define DEF_PIPES 32
|
2013-03-16 22:18:52 -07:00
|
|
|
#define DEF_PIPES_SGX_540 24
|
|
|
|
#define DEF_PIPES_TEGRA_2 8
|
|
|
|
#define DEF_PIPES_TEGRA_3 24
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
#define MIN_ATLAS_ALLOC 16
|
|
|
|
#define MAX_ATLAS_ALLOC 1024
|
2014-06-19 05:35:37 -07:00
|
|
|
#define DEF_ATLAS_ALLOC 256
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
#define MIN_ATLAS_ALLOC_ALPHA 16
|
|
|
|
#define MAX_ATLAS_ALLOC_ALPHA 4096
|
2014-06-19 05:35:37 -07:00
|
|
|
#define DEF_ATLAS_ALLOC_ALPHA 512
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
#define MAX_ATLAS_W 512
|
|
|
|
#define DEF_ATLAS_W 512
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
#define MAX_ATLAS_H 512
|
|
|
|
#define DEF_ATLAS_H 512
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2014-08-16 06:05:56 -07:00
|
|
|
#define ATLAS_FORMATS_COUNT 12
|
2014-07-07 04:14:02 -07:00
|
|
|
|
2014-06-29 23:10:07 -07:00
|
|
|
Eina_List *cspaces; // depend on the values of etc1, etc2 and st3c
|
|
|
|
|
2010-08-25 18:41:48 -07:00
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
int max;
|
|
|
|
} cutout;
|
|
|
|
struct {
|
|
|
|
int max;
|
|
|
|
} pipes;
|
|
|
|
struct {
|
|
|
|
int max_alloc_size;
|
|
|
|
int max_alloc_alpha_size;
|
|
|
|
int max_w;
|
|
|
|
int max_h;
|
|
|
|
} atlas;
|
|
|
|
} tune;
|
2009-10-13 02:40:39 -07:00
|
|
|
} info;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2009-10-13 02:40:39 -07:00
|
|
|
struct {
|
|
|
|
Eina_List *whole;
|
2014-07-07 04:14:02 -07:00
|
|
|
Eina_List *atlas[ATLAS_FORMATS_COUNT];
|
2009-10-13 02:40:39 -07:00
|
|
|
} tex;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2011-04-04 03:23:12 -07:00
|
|
|
Eina_Hash *native_pm_hash;
|
|
|
|
Eina_Hash *native_tex_hash;
|
2014-12-04 00:59:30 -08:00
|
|
|
Eina_Hash *native_wl_hash;
|
2015-01-18 19:28:32 -08:00
|
|
|
Eina_Hash *native_tbm_hash;
|
2015-03-09 01:25:20 -07:00
|
|
|
Eina_Hash *native_evasgl_hash;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2013-02-13 19:27:23 -08:00
|
|
|
#ifdef GL_GLES
|
|
|
|
// FIXME: hack.
|
|
|
|
void *eglctxt;
|
|
|
|
#endif
|
|
|
|
|
2011-08-24 09:20:15 -07:00
|
|
|
Evas_GL_Program shader[SHADER_LAST];
|
|
|
|
|
2009-10-13 02:40:39 -07:00
|
|
|
int references;
|
|
|
|
int w, h;
|
2010-05-08 22:15:20 -07:00
|
|
|
int rot;
|
2010-09-30 23:22:31 -07:00
|
|
|
int mflip;
|
2010-09-21 23:52:28 -07:00
|
|
|
// persp map
|
|
|
|
int foc, z0, px, py;
|
|
|
|
int ax, ay;
|
2015-05-26 17:11:23 -07:00
|
|
|
GLfloat proj[16];
|
2009-10-13 02:40:39 -07:00
|
|
|
};
|
|
|
|
|
2015-04-01 23:50:33 -07:00
|
|
|
typedef enum _Shader_Sampling Shader_Sampling;
|
|
|
|
typedef enum _Shader_Type Shader_Type;
|
|
|
|
|
|
|
|
enum _Shader_Sampling {
|
|
|
|
SHD_SAM11,
|
|
|
|
SHD_SAM12,
|
|
|
|
SHD_SAM21,
|
|
|
|
SHD_SAM22,
|
|
|
|
SHD_SAM_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Shader_Type {
|
|
|
|
SHD_UNKNOWN,
|
|
|
|
SHD_RECT,
|
|
|
|
SHD_FONT,
|
|
|
|
SHD_IMAGE,
|
|
|
|
SHD_YUV,
|
|
|
|
SHD_YUY2,
|
|
|
|
SHD_NV12,
|
2015-05-27 04:17:20 -07:00
|
|
|
SHD_YUV_709,
|
|
|
|
SHD_YUY2_709,
|
|
|
|
SHD_NV12_709,
|
2015-04-01 23:50:33 -07:00
|
|
|
SHD_LINE,
|
|
|
|
SHD_RGB_A_PAIR,
|
|
|
|
SHD_TEX_EXTERNAL,
|
|
|
|
SHD_MAP,
|
|
|
|
SHD_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2012-09-11 23:19:50 -07:00
|
|
|
#define ARRAY_BUFFER_USE 500
|
|
|
|
#define ARRAY_BUFFER_USE_SHIFT 100
|
2010-08-08 20:27:59 -07:00
|
|
|
|
2011-03-16 10:32:49 -07:00
|
|
|
struct _Evas_Engine_GL_Context
|
2009-10-09 05:10:27 -07:00
|
|
|
{
|
|
|
|
int references;
|
|
|
|
int w, h;
|
2010-05-08 22:15:20 -07:00
|
|
|
int rot;
|
2010-09-21 23:52:28 -07:00
|
|
|
int foc, z0, px, py;
|
|
|
|
RGBA_Draw_Context *dc;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2009-10-13 02:40:39 -07:00
|
|
|
Evas_GL_Shared *shared;
|
2010-08-08 20:27:59 -07:00
|
|
|
|
|
|
|
int flushnum;
|
2009-10-09 05:10:27 -07:00
|
|
|
struct {
|
2010-08-08 20:27:59 -07:00
|
|
|
int top_pipe;
|
2009-10-10 06:24:15 -07:00
|
|
|
struct {
|
2015-05-26 17:11:23 -07:00
|
|
|
Evas_GL_Shader id;
|
2009-10-10 06:24:15 -07:00
|
|
|
GLuint cur_prog;
|
2014-12-01 04:11:56 -08:00
|
|
|
GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm;
|
2009-11-12 23:22:31 -08:00
|
|
|
int render_op;
|
2009-12-13 06:28:07 -08:00
|
|
|
int cx, cy, cw, ch;
|
2010-09-30 16:23:51 -07:00
|
|
|
int smooth;
|
|
|
|
int blend;
|
|
|
|
int clip;
|
2014-10-07 23:47:58 -07:00
|
|
|
Eina_Bool anti_alias : 1;
|
2009-10-10 06:24:15 -07:00
|
|
|
} current;
|
2010-08-08 20:27:59 -07:00
|
|
|
} state;
|
2013-05-03 03:31:28 -07:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
|
|
|
Eina_Bool enabled : 1;
|
2013-06-11 02:12:07 -07:00
|
|
|
Eina_Bool used : 1;
|
2013-05-03 03:31:28 -07:00
|
|
|
} master_clip;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2007-06-02 08:30:59 -07:00
|
|
|
struct {
|
2010-08-08 20:27:59 -07:00
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
2015-04-01 23:50:33 -07:00
|
|
|
Shader_Type type;
|
2010-08-08 20:27:59 -07:00
|
|
|
} region;
|
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
|
|
|
Eina_Bool active : 1;
|
|
|
|
} clip;
|
|
|
|
struct {
|
2015-05-26 17:11:23 -07:00
|
|
|
Evas_GL_Shader id;
|
2010-08-08 20:27:59 -07:00
|
|
|
Evas_GL_Image *surface;
|
|
|
|
GLuint cur_prog;
|
2014-12-01 04:11:56 -08:00
|
|
|
GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm;
|
2012-07-26 00:43:47 -07:00
|
|
|
void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn;
|
|
|
|
int render_op;
|
2010-08-08 20:27:59 -07:00
|
|
|
int cx, cy, cw, ch;
|
2010-09-30 16:23:51 -07:00
|
|
|
int smooth;
|
|
|
|
int blend;
|
2015-03-02 03:38:41 -08:00
|
|
|
int mask_smooth;
|
2010-09-30 16:23:51 -07:00
|
|
|
int clip;
|
2010-08-08 20:27:59 -07:00
|
|
|
} shader;
|
|
|
|
struct {
|
|
|
|
int num, alloc;
|
|
|
|
GLshort *vertex;
|
|
|
|
GLubyte *color;
|
|
|
|
GLfloat *texuv;
|
|
|
|
GLfloat *texuv2;
|
|
|
|
GLfloat *texuv3;
|
2014-07-10 20:17:46 -07:00
|
|
|
GLfloat *texa;
|
2015-02-11 21:56:03 -08:00
|
|
|
GLfloat *texsam;
|
2015-03-31 02:58:51 -07:00
|
|
|
GLfloat *mask;
|
2015-09-07 03:21:13 -07:00
|
|
|
GLfloat *masksam;
|
2012-07-26 00:43:47 -07:00
|
|
|
Eina_Bool line: 1;
|
2015-04-12 23:28:16 -07:00
|
|
|
Eina_Bool use_vertex : 1; // always true
|
2010-08-08 20:27:59 -07:00
|
|
|
Eina_Bool use_color : 1;
|
|
|
|
Eina_Bool use_texuv : 1;
|
|
|
|
Eina_Bool use_texuv2 : 1;
|
|
|
|
Eina_Bool use_texuv3 : 1;
|
2014-07-10 20:17:46 -07:00
|
|
|
Eina_Bool use_texa : 1;
|
2015-02-11 21:56:03 -08:00
|
|
|
Eina_Bool use_texsam : 1;
|
2015-03-31 02:58:51 -07:00
|
|
|
Eina_Bool use_mask : 1;
|
2015-09-07 03:21:13 -07:00
|
|
|
Eina_Bool use_masksam : 1;
|
2014-10-07 23:47:58 -07:00
|
|
|
Eina_Bool anti_alias : 1;
|
2010-08-08 20:27:59 -07:00
|
|
|
Evas_GL_Image *im;
|
2012-09-11 23:19:50 -07:00
|
|
|
GLuint buffer;
|
|
|
|
int buffer_alloc;
|
|
|
|
int buffer_use;
|
2010-08-08 20:27:59 -07:00
|
|
|
} array;
|
|
|
|
} pipe[MAX_PIPES];
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct {
|
|
|
|
Eina_Bool size : 1;
|
|
|
|
} change;
|
2012-08-14 01:31:59 -07:00
|
|
|
|
|
|
|
Eina_List *font_glyph_textures;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2011-01-07 02:22:22 -08:00
|
|
|
Eina_Bool havestuff : 1;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2009-11-12 23:22:31 -08:00
|
|
|
Evas_GL_Image *def_surface;
|
2011-04-18 22:47:56 -07:00
|
|
|
|
2013-02-13 19:27:23 -08:00
|
|
|
#ifdef GL_GLES
|
2012-10-26 11:54:45 -07:00
|
|
|
// FIXME: hack. expose egl display to gl core for egl image sec extn.
|
2010-08-13 03:34:51 -07:00
|
|
|
void *egldisp;
|
2013-02-13 19:27:23 -08:00
|
|
|
void *eglctxt;
|
|
|
|
#endif
|
2014-02-14 09:33:47 -08:00
|
|
|
|
|
|
|
GLuint preserve_bit;
|
2015-03-05 02:21:24 -08:00
|
|
|
int gles_version;
|
2015-06-15 01:48:10 -07:00
|
|
|
|
|
|
|
RGBA_Image *font_surface;
|
2003-09-04 00:40:34 -07:00
|
|
|
};
|
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct _Evas_GL_Texture_Pool
|
2003-09-04 00:40:34 -07:00
|
|
|
{
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_Engine_GL_Context *gc;
|
2009-11-12 23:22:31 -08:00
|
|
|
GLuint texture, fb;
|
2009-11-06 03:32:23 -08:00
|
|
|
GLuint intformat, format, dataformat;
|
2003-09-04 00:40:34 -07:00
|
|
|
int w, h;
|
2009-10-09 05:10:27 -07:00
|
|
|
int references;
|
|
|
|
int slot, fslot;
|
2010-08-13 03:34:51 -07:00
|
|
|
struct {
|
|
|
|
void *img;
|
2015-03-01 21:40:12 -08:00
|
|
|
void *buffer;
|
2010-08-13 03:34:51 -07:00
|
|
|
unsigned int *data;
|
|
|
|
int w, h;
|
|
|
|
int stride;
|
2011-11-10 23:36:15 -08:00
|
|
|
int checked_out;
|
2010-08-13 03:34:51 -07:00
|
|
|
} dyn;
|
2009-10-09 05:10:27 -07:00
|
|
|
Eina_List *allocations;
|
2014-06-19 05:35:37 -07:00
|
|
|
Eina_Rectangle_Pool *eina_pool;
|
2009-10-09 05:10:27 -07:00
|
|
|
Eina_Bool whole : 1;
|
2010-01-23 05:49:54 -08:00
|
|
|
Eina_Bool render : 1;
|
|
|
|
Eina_Bool native : 1;
|
2010-08-13 03:34:51 -07:00
|
|
|
Eina_Bool dynamic : 1;
|
2009-10-09 05:10:27 -07:00
|
|
|
};
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2013-06-12 03:37:44 -07:00
|
|
|
struct _Evas_GL_Texture_Alloca
|
|
|
|
{
|
|
|
|
Evas_GL_Texture *tex;
|
|
|
|
int x, w;
|
|
|
|
};
|
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct _Evas_GL_Texture
|
|
|
|
{
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_Engine_GL_Context *gc;
|
2010-01-21 00:44:11 -08:00
|
|
|
Evas_GL_Image *im;
|
2014-07-07 04:14:02 -07:00
|
|
|
Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptt;
|
2015-08-30 18:25:02 -07:00
|
|
|
Evas_GL_Texture_Pool *pt2, *ptu2, *ptv2;
|
2014-07-07 04:14:02 -07:00
|
|
|
union {
|
|
|
|
Evas_GL_Texture_Pool *ptuv;
|
|
|
|
Evas_GL_Texture_Pool *pta;
|
|
|
|
};
|
2012-08-14 01:31:59 -07:00
|
|
|
RGBA_Font_Glyph *fglyph;
|
2009-10-09 05:10:27 -07:00
|
|
|
int x, y, w, h;
|
2013-06-23 19:41:32 -07:00
|
|
|
int tx, ty;
|
2009-10-13 02:40:39 -07:00
|
|
|
double sx1, sy1, sx2, sy2;
|
2003-09-04 00:40:34 -07:00
|
|
|
int references;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2011-09-06 00:56:47 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_GL_Texture_Pool *pt[2], *ptuv[2];
|
|
|
|
int source;
|
|
|
|
} double_buffer;
|
|
|
|
|
2013-06-23 19:41:32 -07:00
|
|
|
Eina_List *targets;
|
2014-06-19 05:35:37 -07:00
|
|
|
Eina_Rectangle *apt, *aptt;
|
2013-06-23 19:41:32 -07:00
|
|
|
|
2010-01-19 06:29:20 -08:00
|
|
|
Eina_Bool alpha : 1;
|
2011-09-30 08:51:32 -07:00
|
|
|
Eina_Bool dyn : 1;
|
2013-06-23 19:41:32 -07:00
|
|
|
Eina_Bool uploaded : 1;
|
|
|
|
Eina_Bool was_preloaded : 1;
|
2003-09-04 00:40:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_GL_Image
|
|
|
|
{
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_Engine_GL_Context *gc;
|
2003-09-04 00:40:34 -07:00
|
|
|
RGBA_Image *im;
|
|
|
|
Evas_GL_Texture *tex;
|
2013-05-06 18:50:57 -07:00
|
|
|
Evas_Image_Load_Opts load_opts;
|
2003-09-04 00:40:34 -07:00
|
|
|
int references;
|
2009-11-12 23:22:31 -08:00
|
|
|
// if im->im == NULL, it's a render-surface so these here are used
|
|
|
|
int w, h;
|
2006-12-17 07:48:52 -08:00
|
|
|
struct {
|
2014-04-08 01:19:38 -07:00
|
|
|
Evas_Colorspace space;
|
2006-12-17 07:48:52 -08:00
|
|
|
void *data;
|
|
|
|
unsigned char no_free : 1;
|
|
|
|
} cs;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2010-01-21 00:44:11 -08:00
|
|
|
struct {
|
|
|
|
void *data;
|
|
|
|
struct {
|
2015-04-20 18:54:02 -07:00
|
|
|
void (*bind) (void *data, void *image);
|
|
|
|
void (*unbind) (void *data, void *image);
|
|
|
|
void (*free) (void *data, void *image);
|
|
|
|
int (*yinvert) (void *data, void *image);
|
2010-01-21 00:44:11 -08:00
|
|
|
void *data;
|
|
|
|
} func;
|
2010-01-30 18:50:01 -08:00
|
|
|
int yinvert;
|
|
|
|
int target;
|
|
|
|
int mipmap;
|
2010-01-23 21:11:54 -08:00
|
|
|
unsigned char loose : 1;
|
2010-01-21 00:44:11 -08:00
|
|
|
} native;
|
2010-08-11 23:11:13 -07:00
|
|
|
|
2015-02-25 02:05:12 -08:00
|
|
|
struct {
|
|
|
|
Evas_GL_Image *origin;
|
|
|
|
Eina_Bool smooth : 1;
|
|
|
|
} scaled;
|
|
|
|
|
2010-08-11 23:11:13 -07:00
|
|
|
int scale_hint, content_hint;
|
2011-02-10 22:23:10 -08:00
|
|
|
int csize;
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2015-04-22 02:25:38 -07:00
|
|
|
Eina_List *filtered;
|
|
|
|
Eina_List *targets;
|
|
|
|
Evas_Image_Orient orient;
|
2011-04-18 22:47:56 -07:00
|
|
|
|
2006-12-06 06:58:00 -08:00
|
|
|
unsigned char dirty : 1;
|
|
|
|
unsigned char cached : 1;
|
2009-11-12 23:22:31 -08:00
|
|
|
unsigned char alpha : 1;
|
|
|
|
unsigned char tex_only : 1;
|
2014-03-06 00:42:24 -08:00
|
|
|
unsigned char locked : 1; // gl_surface_lock/unlock
|
2015-03-02 23:38:52 -08:00
|
|
|
unsigned char direct : 1; // evas gl direct renderable
|
2015-04-22 06:15:08 -07:00
|
|
|
/*Disable generate atlas for texture unit, EINA_FALSE by default*/
|
|
|
|
Eina_Bool disable_atlas : 1;
|
2003-09-04 00:40:34 -07:00
|
|
|
};
|
|
|
|
|
2009-10-09 05:10:27 -07:00
|
|
|
struct _Evas_GL_Font_Texture
|
|
|
|
{
|
|
|
|
Evas_GL_Texture *tex;
|
|
|
|
};
|
2009-12-26 16:40:25 -08:00
|
|
|
|
2003-09-04 00:40:34 -07:00
|
|
|
struct _Evas_GL_Polygon
|
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *points;
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool changed : 1;
|
2003-09-04 00:40:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_GL_Polygon_Point
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
|
2013-06-23 19:41:32 -07:00
|
|
|
struct _Evas_GL_Texture_Async_Preload
|
|
|
|
{
|
|
|
|
Evas_GL_Texture *tex;
|
|
|
|
RGBA_Image *im;
|
|
|
|
|
|
|
|
Eina_Bool unpack_row_length;
|
|
|
|
};
|
|
|
|
|
2014-07-11 06:10:53 -07:00
|
|
|
/* GL_Common function that are used by gl_generic inherited module */
|
|
|
|
EAPI void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
|
|
|
|
EAPI void evas_gl_common_image_ref(Evas_GL_Image *im);
|
|
|
|
EAPI void evas_gl_common_image_unref(Evas_GL_Image *im);
|
|
|
|
EAPI Evas_GL_Image *evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, Evas_Colorspace cspace);
|
|
|
|
EAPI void evas_gl_common_image_native_disable(Evas_GL_Image *im);
|
|
|
|
EAPI void evas_gl_common_image_free(Evas_GL_Image *im);
|
|
|
|
EAPI void evas_gl_common_image_native_enable(Evas_GL_Image *im);
|
|
|
|
|
2015-03-04 00:11:26 -08:00
|
|
|
EAPI int evas_gl_preload_init(void);
|
|
|
|
EAPI int evas_gl_preload_shutdown(void);
|
|
|
|
EAPI Eina_Bool evas_gl_preload_enabled(void);
|
2014-07-11 06:10:53 -07:00
|
|
|
|
|
|
|
EAPI Evas_Engine_GL_Context *evas_gl_common_context_new(void);
|
|
|
|
|
|
|
|
EAPI void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
|
|
|
|
EAPI void evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
|
|
|
|
EAPI void evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
|
|
|
|
EAPI void evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc);
|
|
|
|
EAPI void evas_gl_common_context_done(Evas_Engine_GL_Context *gc);
|
|
|
|
|
|
|
|
EAPI void evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot);
|
|
|
|
EAPI int evas_gl_common_buffer_dump(Evas_Engine_GL_Context *gc, const char* dname, const char* fname, int frame, const char* suffix);
|
|
|
|
|
|
|
|
EAPI void evas_gl_preload_render_lock(evas_gl_make_current_cb make_current, void *engine_data);
|
|
|
|
EAPI void evas_gl_preload_render_unlock(evas_gl_make_current_cb make_current, void *engine_data);
|
|
|
|
EAPI void evas_gl_preload_render_relax(evas_gl_make_current_cb make_current, void *engine_data);
|
2014-07-25 11:05:37 -07:00
|
|
|
EAPI void evas_gl_symbols(void *(*GetProcAddress)(const char *name));
|
2014-07-11 06:10:53 -07:00
|
|
|
|
2014-09-01 20:52:52 -07:00
|
|
|
EAPI void evas_gl_common_error_set(void *data, int error_enum);
|
|
|
|
EAPI int evas_gl_common_error_get(void *data);
|
|
|
|
EAPI void *evas_gl_common_current_context_get(void);
|
|
|
|
|
2014-07-11 06:10:53 -07:00
|
|
|
typedef int (*Evas_GL_Preload)(void);
|
|
|
|
typedef void (*Evas_GL_Common_Image_Call)(Evas_GL_Image *im);
|
|
|
|
typedef void (*Evas_GL_Common_Context_Call)(Evas_Engine_GL_Context *gc);
|
|
|
|
typedef Evas_GL_Image *(*Evas_GL_Common_Image_New_From_Data)(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, Evas_Colorspace cspace);
|
|
|
|
typedef void (*Evas_GL_Preload_Render_Call)(evas_gl_make_current_cb make_current, void *engine_data);
|
|
|
|
typedef Evas_Engine_GL_Context *(*Evas_GL_Common_Context_New)(void);
|
|
|
|
typedef void (*Evas_GL_Common_Context_Resize_Call)(Evas_Engine_GL_Context *gc, int w, int h, int rot);
|
|
|
|
typedef int (*Evas_GL_Common_Buffer_Dump_Call)(Evas_Engine_GL_Context *gc,const char* dname, const char* fname, int frame, const char* suffix);
|
2014-07-25 11:05:37 -07:00
|
|
|
typedef void (*Evas_Gl_Symbols)(void *(*GetProcAddress)(const char *sym));
|
2014-07-11 06:10:53 -07:00
|
|
|
|
2015-02-11 04:45:50 -08:00
|
|
|
EAPI void __evas_gl_err(int err, const char *file, const char *func, int line, const char *op);
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2014-02-14 09:33:47 -08:00
|
|
|
void evas_gl_common_tiling_start(Evas_Engine_GL_Context *gc,
|
|
|
|
int rot, int gw, int gh,
|
|
|
|
int cx, int cy, int cw, int ch,
|
|
|
|
int bitmask);
|
|
|
|
void evas_gl_common_tiling_done(Evas_Engine_GL_Context *gc);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface);
|
|
|
|
|
|
|
|
void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
|
2009-12-30 03:35:40 -08:00
|
|
|
int x1, int y1, int x2, int y2,
|
|
|
|
int clip, int cx, int cy, int cw, int ch,
|
2015-03-31 18:39:36 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2009-12-30 03:35:40 -08:00
|
|
|
int r, int g, int b, int a);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
|
2009-10-09 05:10:27 -07:00
|
|
|
int x, int y, int w, int h,
|
2014-12-01 22:19:10 -08:00
|
|
|
int r, int g, int b, int a,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
|
2009-10-09 05:10:27 -07:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2009-10-09 05:10:27 -07:00
|
|
|
int r, int g, int b, int a,
|
2010-01-21 00:44:11 -08:00
|
|
|
Eina_Bool smooth, Eina_Bool tex_only);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
|
2009-10-09 05:10:27 -07:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2009-10-09 05:10:27 -07:00
|
|
|
int r, int g, int b, int a);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
|
2009-10-10 06:24:15 -07:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2009-10-10 06:24:15 -07:00
|
|
|
int r, int g, int b, int a,
|
|
|
|
Eina_Bool smooth);
|
2015-05-27 04:17:20 -07:00
|
|
|
void evas_gl_common_context_yuv_709_push(Evas_Engine_GL_Context *gc,
|
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
|
|
|
int r, int g, int b, int a,
|
|
|
|
Eina_Bool smooth);
|
2011-08-23 08:13:40 -07:00
|
|
|
void evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
|
2012-07-26 00:43:47 -07:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2012-07-26 00:43:47 -07:00
|
|
|
int r, int g, int b, int a,
|
|
|
|
Eina_Bool smooth);
|
2011-08-29 13:56:48 -07:00
|
|
|
void evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
|
2012-07-26 00:43:47 -07:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2012-07-26 00:43:47 -07:00
|
|
|
int r, int g, int b, int a,
|
|
|
|
Eina_Bool smooth);
|
2014-07-07 04:14:02 -07:00
|
|
|
void evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
|
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
double sx, double sy, double sw, double sh,
|
|
|
|
int x, int y, int w, int h,
|
2015-03-31 02:58:51 -07:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2014-07-07 04:14:02 -07:00
|
|
|
int r, int g, int b, int a,
|
|
|
|
Eina_Bool smooth);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
|
2011-02-09 22:52:53 -08:00
|
|
|
Evas_GL_Texture *tex,
|
|
|
|
int npoints,
|
|
|
|
RGBA_Map_Point *p,
|
|
|
|
int clip, int cx, int cy, int cw, int ch,
|
2015-02-26 03:42:45 -08:00
|
|
|
Evas_GL_Texture *mtex, int mx, int my, int mw, int mh, Eina_Bool mask_smooth,
|
2011-02-09 22:52:53 -08:00
|
|
|
int r, int g, int b, int a,
|
2011-06-17 00:47:28 -07:00
|
|
|
Eina_Bool smooth,
|
2011-02-09 22:52:53 -08:00
|
|
|
Eina_Bool tex_only,
|
2012-07-26 00:43:47 -07:00
|
|
|
Evas_Colorspace cspace);
|
2009-10-09 05:10:27 -07:00
|
|
|
|
From: Jiyoun Park <jy0703.park@samsung.com>
Subject: [E-devel] [Patch] Evas gl shader use binary shader
I make patch related with evas gl binary shader.
The concept of binary shader is compile shader only once.
Some people want to use binary shader because of performance issue.
In current evas gl engine, every application have to compile shader each
time.
But I modify code , so only first running application need compile shader.
Other application use already compiled shader(binary shader)
The binary shader is made under HOME/.evas/gl_common_shaders directory.
Binary shader is created according to GL vendor,GL renderer, GL version and
Module_arch.
The basic flow is
1. First running application which use gl engine check binary shader
directory, but it can't find binary shader.
2. After compiling shader, It saves compiled shaders..
3. Other application checks shader directory, it can use binary
shaders.
In mobile target, using binary shader, I can save 150ms. (that time, there
is 11 shaders).
If there is more shaders and more applications, this flow maybe save more
total time.
(the above is now in, changelog coming, with change to using ~/.cache,
some formatting fixes, make ity do the desktop gl one right with the
retrievable hint parameter ont he program etc. - doesn't break desktop
gl at least. yay. a,so fixes to mke it compile at all).
SVN revision: 59167
2011-05-03 23:15:00 -07:00
|
|
|
int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
|
2011-03-29 02:10:57 -07:00
|
|
|
void evas_gl_common_shader_program_init_done(void);
|
2010-03-23 02:55:02 -07:00
|
|
|
void evas_gl_common_shader_program_shutdown(Evas_GL_Program *p);
|
2015-09-07 03:21:13 -07:00
|
|
|
Evas_GL_Shader evas_gl_common_img_shader_select(Shader_Sampling sam, int nomul, int afill, int bgra, int mask, int masksam);
|
2015-04-01 23:50:33 -07:00
|
|
|
const char *evas_gl_common_shader_name_get(Evas_GL_Shader shd);
|
2011-06-17 00:47:28 -07:00
|
|
|
|
2013-01-06 22:16:18 -08:00
|
|
|
Eina_Bool evas_gl_common_file_cache_is_dir(const char *file);
|
|
|
|
Eina_Bool evas_gl_common_file_cache_mkdir(const char *dir);
|
|
|
|
Eina_Bool evas_gl_common_file_cache_file_exists(const char *file);
|
|
|
|
Eina_Bool evas_gl_common_file_cache_mkpath_if_not_exists(const char *path);
|
|
|
|
Eina_Bool evas_gl_common_file_cache_mkpath(const char *path);
|
|
|
|
int evas_gl_common_file_cache_dir_check(char *cache_dir, int num);
|
|
|
|
int evas_gl_common_file_cache_file_check(const char *cache_dir, const char *cache_name, char *cache_file, int dir_num);
|
|
|
|
int evas_gl_common_file_cache_save(Evas_GL_Shared *shared);
|
|
|
|
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2011-01-13 02:41:08 -08:00
|
|
|
void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
|
2015-04-22 06:15:08 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im, Eina_Bool disable_atlas);
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im);
|
|
|
|
Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
|
|
|
|
Evas_GL_Texture *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
|
2009-10-09 05:10:27 -07:00
|
|
|
void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im);
|
2014-03-20 19:54:27 -07:00
|
|
|
void evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int bytes_count);
|
2013-06-13 23:51:18 -07:00
|
|
|
void evas_gl_common_texture_free(Evas_GL_Texture *tex, Eina_Bool force);
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
|
2010-09-18 16:16:25 -07:00
|
|
|
void evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
|
2010-09-18 16:16:25 -07:00
|
|
|
void evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
|
2011-08-23 08:13:40 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
|
|
|
|
void evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
|
2011-08-29 13:56:48 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
|
|
|
|
void evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
|
|
|
|
Evas_GL_Texture *evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
|
|
|
|
void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
|
2014-07-07 04:14:02 -07:00
|
|
|
Evas_GL_Texture *evas_gl_common_texture_rgb_a_pair_new(Evas_Engine_GL_Context *gc, RGBA_Image *im);
|
|
|
|
void evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex, RGBA_Image *im);
|
2009-10-10 06:24:15 -07:00
|
|
|
|
2013-10-16 01:20:14 -07:00
|
|
|
void evas_gl_common_image_alloc_ensure(Evas_GL_Image *im);
|
2011-03-16 10:32:49 -07:00
|
|
|
Evas_GL_Image *evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
|
2013-05-07 23:37:37 -07:00
|
|
|
Evas_GL_Image *evas_gl_common_image_mmap(Evas_Engine_GL_Context *gc, Eina_File *f, const char *key, Evas_Image_Load_Opts *lo, int *error);
|
2014-04-08 01:19:38 -07:00
|
|
|
Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, Evas_Colorspace cspace);
|
|
|
|
Evas_GL_Image *evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_Colorspace cspace);
|
2010-02-21 07:49:44 -08:00
|
|
|
Evas_GL_Image *evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha);
|
2010-08-11 23:11:13 -07:00
|
|
|
void evas_gl_common_image_scale_hint_set(Evas_GL_Image *im, int hint);
|
|
|
|
void evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc);
|
|
|
|
Evas_GL_Image *evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
|
2010-09-18 16:16:25 -07:00
|
|
|
void evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
|
2011-04-18 22:47:56 -07:00
|
|
|
void evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int npoints, RGBA_Map_Point *p, int smooth, int level);
|
|
|
|
void evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2009-12-21 07:52:12 -08:00
|
|
|
void *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg);
|
|
|
|
void evas_gl_font_texture_free(void *);
|
|
|
|
void evas_gl_font_texture_draw(void *gc, void *surface, void *dc, RGBA_Font_Glyph *fg, int x, int y);
|
2015-03-19 03:02:02 -07:00
|
|
|
void *evas_gl_image_new_from_data(void *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, Evas_Colorspace cspace);
|
|
|
|
void evas_gl_image_free(void *im);
|
|
|
|
void evas_gl_image_draw(void *gc, void *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2009-12-26 16:40:25 -08:00
|
|
|
Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
|
|
|
|
Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
|
2009-10-09 05:10:27 -07:00
|
|
|
|
2011-03-16 10:32:49 -07:00
|
|
|
void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
|
2009-12-30 03:35:40 -08:00
|
|
|
|
2012-09-14 00:27:49 -07:00
|
|
|
extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
|
|
|
|
extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
|
|
|
|
extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
|
|
|
|
extern void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b);
|
|
|
|
extern void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e);
|
|
|
|
extern void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d);
|
|
|
|
extern void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d);
|
|
|
|
extern void (*glsym_glReleaseShaderCompiler)(void);
|
|
|
|
extern void *(*glsym_glMapBuffer) (GLenum a, GLenum b);
|
|
|
|
extern GLboolean (*glsym_glUnmapBuffer) (GLenum a);
|
2014-06-11 20:47:32 -07:00
|
|
|
|
2012-09-23 20:33:43 -07:00
|
|
|
#ifdef GL_GLES
|
2011-12-17 21:03:24 -08:00
|
|
|
extern void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e);
|
|
|
|
extern unsigned int (*secsym_eglDestroyImage) (void *a, void *b);
|
|
|
|
extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
|
2013-04-12 01:34:13 -07:00
|
|
|
extern void *(*secsym_eglMapImageSEC) (void *a, void *b, int c, int d);
|
|
|
|
extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b, int c);
|
2011-12-17 21:03:24 -08:00
|
|
|
extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d);
|
2015-03-01 21:40:12 -08:00
|
|
|
|
|
|
|
// TBM Surface stuff
|
|
|
|
#define TBM_SURF_PLANE_MAX 4 /**< maximum number of planes */
|
|
|
|
|
|
|
|
/* option to map the tbm_surface */
|
|
|
|
#define TBM_SURF_OPTION_READ (1 << 0) /**< access option to read */
|
|
|
|
#define TBM_SURF_OPTION_WRITE (1 << 1) /**< access option to write */
|
|
|
|
|
|
|
|
#define __tbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
|
|
|
|
((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
|
|
|
|
|
|
|
|
#define TBM_FORMAT_C8 __tbm_fourcc_code('C', '8', ' ', ' ')
|
|
|
|
#define TBM_FORMAT_RGBA8888 __tbm_fourcc_code('R', 'A', '2', '4')
|
|
|
|
#define TBM_FORMAT_BGRA8888 __tbm_fourcc_code('B', 'A', '2', '4')
|
|
|
|
#define TBM_FORMAT_RGB888 __tbm_fourcc_code('R', 'G', '2', '4')
|
|
|
|
|
|
|
|
typedef struct _tbm_surface * tbm_surface_h;
|
|
|
|
typedef uint32_t tbm_format;
|
|
|
|
typedef struct _tbm_surface_plane
|
|
|
|
{
|
|
|
|
unsigned char *ptr; /**< Plane pointer */
|
|
|
|
uint32_t size; /**< Plane size */
|
|
|
|
uint32_t offset; /**< Plane offset */
|
|
|
|
uint32_t stride; /**< Plane stride */
|
|
|
|
|
|
|
|
void *reserved1; /**< Reserved pointer1 */
|
|
|
|
void *reserved2; /**< Reserved pointer2 */
|
|
|
|
void *reserved3; /**< Reserved pointer3 */
|
|
|
|
} tbm_surface_plane_s;
|
|
|
|
|
|
|
|
typedef struct _tbm_surface_info
|
|
|
|
{
|
|
|
|
uint32_t width; /**< TBM surface width */
|
|
|
|
uint32_t height; /**< TBM surface height */
|
|
|
|
tbm_format format; /**< TBM surface format*/
|
|
|
|
uint32_t bpp; /**< TBM surface bbp */
|
|
|
|
uint32_t size; /**< TBM surface size */
|
|
|
|
|
|
|
|
uint32_t num_planes; /**< The number of planes */
|
|
|
|
tbm_surface_plane_s planes[TBM_SURF_PLANE_MAX]; /**< Array of planes */
|
|
|
|
|
|
|
|
void *reserved4; /**< Reserved pointer4 */
|
|
|
|
void *reserved5; /**< Reserved pointer5 */
|
|
|
|
void *reserved6; /**< Reserved pointer6 */
|
|
|
|
} tbm_surface_info_s;
|
|
|
|
|
|
|
|
|
|
|
|
extern void *(*secsym_tbm_surface_create) (int width, int height, unsigned int format);
|
|
|
|
extern int (*secsym_tbm_surface_destroy) (void *surface);
|
|
|
|
extern int (*secsym_tbm_surface_map) (void *surface, int opt, void *info);
|
|
|
|
extern int (*secsym_tbm_surface_unmap) (void *surface);
|
|
|
|
extern int (*secsym_tbm_surface_get_info) (void *surface, void *info);
|
2011-12-17 21:03:24 -08:00
|
|
|
#endif
|
|
|
|
|
2013-06-23 19:41:32 -07:00
|
|
|
Eina_Bool evas_gl_preload_push(Evas_GL_Texture_Async_Preload *async);
|
|
|
|
void evas_gl_preload_pop(Evas_GL_Texture *tex);
|
|
|
|
void evas_gl_preload_target_register(Evas_GL_Texture *tex, Eo *target);
|
|
|
|
void evas_gl_preload_target_unregister(Evas_GL_Texture *tex, Eo *target);
|
|
|
|
|
|
|
|
void pt_unref(Evas_GL_Texture_Pool *pt);
|
|
|
|
|
2015-05-12 18:17:12 -07:00
|
|
|
// Enable GL errors logging
|
2013-12-27 00:32:15 -08:00
|
|
|
//#define GL_ERRORS 1
|
2015-05-12 18:17:12 -07:00
|
|
|
// Enable very basic GL calls logging (requires GL_ERRORS)
|
|
|
|
//#define GL_ERRORS_TRACE 1
|
2010-02-16 20:21:59 -08:00
|
|
|
|
|
|
|
#ifdef GL_ERRORS
|
2015-02-11 04:45:50 -08:00
|
|
|
#include <dlfcn.h>
|
|
|
|
static inline void
|
|
|
|
__evas_gl_errdyn(int err, const char *file, const char *func, int line, const char *op)
|
|
|
|
{
|
|
|
|
static void (*sym)(int,const char*,const char*,int,const char*) = NULL;
|
|
|
|
if (!sym) sym = dlsym(RTLD_DEFAULT, "__evas_gl_err");
|
|
|
|
sym(err, file, func, line, op);
|
|
|
|
}
|
|
|
|
# define GLERRV(op) \
|
|
|
|
{ \
|
2011-12-17 21:03:24 -08:00
|
|
|
int __gl_err = glGetError(); \
|
2015-02-11 04:45:50 -08:00
|
|
|
if (__gl_err != GL_NO_ERROR) \
|
|
|
|
__evas_gl_errdyn(__gl_err, __FILE__, __FUNCTION__, __LINE__, op); \
|
2010-02-16 20:30:58 -08:00
|
|
|
}
|
2015-02-11 04:45:50 -08:00
|
|
|
/* Redefine common gl funcs */
|
|
|
|
# ifndef GL_ERRORS_NODEF
|
2015-05-12 18:17:12 -07:00
|
|
|
# ifndef GL_ERRORS_TRACE
|
|
|
|
# define GL_ERROR_TRACE(f, _args, ...) do { f(__VA_ARGS__); GLERRV(#f); } while(0)
|
|
|
|
# define GL_ERROR_TRACE_RET(t, f, _args, ...) ({ t _r = f(__VA_ARGS__); GLERRV(#f); _r; })
|
|
|
|
# else
|
|
|
|
# define GL_ERROR_TRACE(f, _args, ...) do { DBG("%s(%s);", #f, _args); f(__VA_ARGS__); GLERRV(#f); } while(0)
|
|
|
|
# define GL_ERROR_TRACE_RET(t, f, _args, ...) ({ t _r; DBG("%s(%s);", #f, _args); _r = f(__VA_ARGS__); GLERRV(#f); _r; })
|
|
|
|
# endif
|
|
|
|
# define glActiveTexture(...) GL_ERROR_TRACE(glActiveTexture, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBindAttribLocation(...) GL_ERROR_TRACE(glBindAttribLocation, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBindBuffer(...) GL_ERROR_TRACE(glBindBuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBindTexture(...) GL_ERROR_TRACE(glBindTexture, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBlendFunc(...) GL_ERROR_TRACE(glBlendFunc, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBufferData(...) GL_ERROR_TRACE(glBufferData, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glCompressedTexSubImage2D(...) GL_ERROR_TRACE(glCompressedTexSubImage2D, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glDeleteBuffers(...) GL_ERROR_TRACE(glDeleteBuffers, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glDepthMask(...) GL_ERROR_TRACE(glDepthMask, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glDisable(...) GL_ERROR_TRACE(glDisable, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glDisableVertexAttribArray(...) GL_ERROR_TRACE(glDisableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glDrawArrays(...) GL_ERROR_TRACE(glDrawArrays, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glEnable(...) GL_ERROR_TRACE(glEnable, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glEnableVertexAttribArray(...) GL_ERROR_TRACE(glEnableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGenBuffers(...) GL_ERROR_TRACE(glGenBuffers, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetFloatv(...) GL_ERROR_TRACE(glGetFloatv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetIntegerv(...) GL_ERROR_TRACE(glGetIntegerv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetUniformLocation(...) GL_ERROR_TRACE_RET(GLuint, glGetUniformLocation, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glHint(...) GL_ERROR_TRACE(glHint, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glReadPixels(...) GL_ERROR_TRACE(glReadPixels, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glScissor(...) GL_ERROR_TRACE(glScissor, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGenFramebuffers(...) GL_ERROR_TRACE(glGenFramebuffers, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glBindFramebuffer(...) GL_ERROR_TRACE(glBindFramebuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glEndTiling(...) GL_ERROR_TRACE(glEndTiling, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetProgramBinary(...) GL_ERROR_TRACE(glGetProgramBinary, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glMapBuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glStartTiling(...) GL_ERROR_TRACE(glStartTiling, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUnmapBuffer(...) GL_ERROR_TRACE(glUnmapBuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glTexParameterf(...) GL_ERROR_TRACE(glTexParameterf, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glTexParameteri(...) GL_ERROR_TRACE(glTexParameteri, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glTexSubImage2D(...) GL_ERROR_TRACE(glTexSubImage2D, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUniform1f(...) GL_ERROR_TRACE(glUniform1f, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUniform1i(...) GL_ERROR_TRACE(glUniform1i, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUniform2fv(...) GL_ERROR_TRACE(glUniform2fv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUniform4fv(...) GL_ERROR_TRACE(glUniform4fv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUniformMatrix4fv(...) GL_ERROR_TRACE(glUniformMatrix4fv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glUseProgram(...) GL_ERROR_TRACE(glUseProgram, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glVertexAttribPointer(...) GL_ERROR_TRACE(glVertexAttribPointer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glViewport(...) GL_ERROR_TRACE(glViewport, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glPixelStorei(...) GL_ERROR_TRACE(glPixelStorei, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glCompressedTexImage2D(...) GL_ERROR_TRACE(glCompressedTexImage2D, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glCreateShader(...) GL_ERROR_TRACE_RET(GLuint, glCreateShader, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glCreateProgram(...) GL_ERROR_TRACE_RET(GLuint, glCreateProgram, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glAttachShader(...) GL_ERROR_TRACE(glAttachShader, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glLinkProgram(...) GL_ERROR_TRACE(glLinkProgram, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetProgramiv(...) GL_ERROR_TRACE(glGetProgramiv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetProgramInfoLog(...) GL_ERROR_TRACE(glGetProgramInfoLog, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glGetShaderiv(...) GL_ERROR_TRACE(glGetShaderiv, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glShaderSource(...) GL_ERROR_TRACE(glShaderSource, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glCompileShader(...) GL_ERROR_TRACE(glCompileShader, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glGenFramebuffers(...) GL_ERROR_TRACE(glsym_glGenFramebuffers, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glBindFramebuffer(...) GL_ERROR_TRACE(glsym_glBindFramebuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glFramebufferTexture2D(...) GL_ERROR_TRACE(glsym_glFramebufferTexture2D, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glDeleteFramebuffers(...) GL_ERROR_TRACE(glsym_glDeleteFramebuffers, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glGetProgramBinary(...) GL_ERROR_TRACE(glsym_glGetProgramBinary, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glProgramBinary(...) GL_ERROR_TRACE(glsym_glProgramBinary, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glProgramParameteri(...) GL_ERROR_TRACE(glsym_glProgramParameteri, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glReleaseShaderCompiler(...) GL_ERROR_TRACE(glsym_glReleaseShaderCompiler, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glsym_glMapBuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define glsym_glUnmapBuffer(...) GL_ERROR_TRACE_RET(unsigned int, glsym_glUnmapBuffer, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_eglCreateImage(...) GL_ERROR_TRACE_RET(void *, secsym_eglCreateImage, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_eglDestroyImage(...) GL_ERROR_TRACE_RET(unsigned int, secsym_eglDestroyImage, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_glEGLImageTargetTexture2DOES(...) GL_ERROR_TRACE(secsym_glEGLImageTargetTexture2DOES, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_eglMapImageSEC(...) GL_ERROR_TRACE_RET(void *, secsym_eglMapImageSEC, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_eglUnmapImageSEC(...) GL_ERROR_TRACE_RET(unsigned int, secsym_eglUnmapImageSEC, #__VA_ARGS__, __VA_ARGS__)
|
|
|
|
# define secsym_eglGetImageAttribSEC(...) GL_ERROR_TRACE_RET(unsigned int, secsym_eglGetImageAttribSEC, #__VA_ARGS__, __VA_ARGS__)
|
2015-02-11 04:45:50 -08:00
|
|
|
# endif
|
2010-02-16 20:21:59 -08:00
|
|
|
#else
|
2015-02-11 04:45:50 -08:00
|
|
|
# define GLERRV(op)
|
2010-02-16 20:21:59 -08:00
|
|
|
#endif
|
|
|
|
|
2010-10-07 16:46:42 -07:00
|
|
|
Eina_Bool evas_gl_common_module_open(void);
|
|
|
|
void evas_gl_common_module_close(void);
|
|
|
|
|
2013-06-23 19:41:32 -07:00
|
|
|
static inline void
|
2013-07-10 20:39:44 -07:00
|
|
|
_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix)
|
2013-06-23 19:41:32 -07:00
|
|
|
{
|
2013-07-10 20:39:44 -07:00
|
|
|
if ((w > gc->shared->info.max_texture_size) ||
|
|
|
|
(h > gc->shared->info.max_texture_size)) return;
|
2013-06-23 19:41:32 -07:00
|
|
|
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
|
|
|
|
}
|
|
|
|
|
2014-07-07 04:14:02 -07:00
|
|
|
static inline void
|
|
|
|
_comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int imgsize, const void *pix)
|
|
|
|
{
|
|
|
|
if ((w > gc->shared->info.max_texture_size) ||
|
|
|
|
(h > gc->shared->info.max_texture_size)) return;
|
|
|
|
glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix);
|
|
|
|
}
|
|
|
|
|
2013-12-26 23:56:30 -08:00
|
|
|
#include "evas_gl_3d_common.h"
|
|
|
|
|
2015-04-28 05:24:11 -07:00
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
|
|
|
|
2015-08-18 01:35:40 -07:00
|
|
|
extern Eina_Bool _need_context_restore;
|
|
|
|
extern void _context_restore(void);
|
|
|
|
EAPI void evas_gl_context_restore_set(Eina_Bool enable);
|
|
|
|
|
2003-09-04 00:40:34 -07:00
|
|
|
#endif
|