22 #include <type_traits> 27 "attribute vec4 a_Position;\n" 28 "attribute vec2 a_TexCoord;\n" 30 "varying vec2 v_TexCoord;\n" 33 " gl_Position = a_Position;\n" 34 " v_TexCoord = a_TexCoord;\n" 38 "#extension GL_OES_EGL_image_external : require\n" 40 "precision mediump float;\n" 41 "varying vec2 v_TexCoord;\n" 42 "uniform samplerExternalOES sTexture;\n" 45 " vec4 sample = texture2D(sTexture, v_TexCoord);\n" 46 " float grey = 0.21 * sample.r + 0.71 * sample.g + 0.07 * sample.b;\n" 47 " gl_FragColor = vec4(grey, grey, grey, 0.5);\n" 58 LOGE(
"Could not create program.");
73 glActiveTexture(GL_TEXTURE0);
74 glBindTexture(GL_TEXTURE_EXTERNAL_OES,
texture_id_);
82 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
static const char kFragmentShader[]
GLuint CreateProgram(const char *vertex_source, const char *fragment_source)
static constexpr int kNumVertices
static const GLfloat BackgroundRenderer_kVertices[]
GLuint attribute_vertices_
void InitializeGlContent(GLuint textureId)
void CheckGlError(const char *operation)
static const char kVertexShader[]
void Draw(const float *transformed_uvs)