Encapsulate textures into their own Texture class
the main reason for doing this is so that we can have
access to informations about a texture (like its dimension)
close to where we generate and use shaders in ES 2.0.
Previously, there wasn't any way to get to a texture's size
from a RenderEngine implementation.
Bug: 8679321
Change-Id: I388b338a70d07e3e8177dde248710ea1e4c82dff
diff --git a/services/surfaceflinger/RenderEngine/Description.h b/services/surfaceflinger/RenderEngine/Description.h
index 47b0d8e..862301b 100644
--- a/services/surfaceflinger/RenderEngine/Description.h
+++ b/services/surfaceflinger/RenderEngine/Description.h
@@ -15,6 +15,7 @@
*/
#include <GLES2/gl2.h>
+#include "Texture.h"
#ifndef SF_RENDER_ENGINE_DESCRIPTION_H_
#define SF_RENDER_ENGINE_DESCRIPTION_H_
@@ -40,17 +41,15 @@
bool mPremultipliedAlpha;
// whether this layer is marked as opaque
bool mOpaque;
- // texture target, TEXTURE_2D or TEXTURE_EXTERNAL
- GLenum mTextureTarget;
- // name of the texture
- GLuint mTextureName;
+ // Texture this layer uses
+ Texture mTexture;
+ bool mTextureEnabled;
+
// color used when texturing is disabled
GLclampf mColor[4];
// projection matrix
GLfloat mProjectionMatrix[16];
- // texture matrix
- GLfloat mTextureMatrix[16];
public:
Description();
@@ -59,11 +58,10 @@
void setPlaneAlpha(GLclampf planeAlpha);
void setPremultipliedAlpha(bool premultipliedAlpha);
void setOpaque(bool opaque);
- void setTextureName(GLenum target, GLuint tname);
+ void setTexture(const Texture& texture);
void disableTexture();
void setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void setProjectionMatrix(GLfloat const* mtx);
- void setTextureMatrix(GLfloat const* mtx);
private:
bool mUniformsDirty;