Loading services/surfaceflinger/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ LOCAL_SRC_FILES:= \ RenderEngine/ProgramCache.cpp \ RenderEngine/GLExtensions.cpp \ RenderEngine/RenderEngine.cpp \ RenderEngine/Texture.cpp \ RenderEngine/GLES10RenderEngine.cpp \ RenderEngine/GLES11RenderEngine.cpp \ RenderEngine/GLES20RenderEngine.cpp Loading services/surfaceflinger/Layer.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, { mCurrentCrop.makeInvalid(); mFlinger->getRenderEngine().genTextures(1, &mTextureName); mTexture.init(Texture::TEXTURE_EXTERNAL, mTextureName); uint32_t layerFlags = 0; if (flags & ISurfaceComposerClient::eHidden) Loading Loading @@ -483,7 +484,11 @@ void Layer::onDraw(const sp<const DisplayDevice>& hw, const Region& clip) const mSurfaceFlingerConsumer->getTransformMatrix(textureMatrix); // Set things up for texturing. engine.setupLayerTexturing(mTextureName, useFiltering, textureMatrix); mTexture.setDimensions(mActiveBuffer->getWidth(), mActiveBuffer->getHeight()); mTexture.setFiltering(useFiltering); mTexture.setMatrix(textureMatrix); engine.setupLayerTexturing(mTexture); } else { engine.setupLayerBlackedOut(); } Loading services/surfaceflinger/Layer.h +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include "DisplayHardware/HWComposer.h" #include "DisplayHardware/FloatRect.h" #include "RenderEngine/Mesh.h" #include "RenderEngine/Texture.h" namespace android { Loading Loading @@ -359,6 +360,8 @@ private: bool mNeedsFiltering; // The mesh used to draw the layer in GLES composition mode mutable Mesh mMesh; // The mesh used to draw the layer in GLES composition mode mutable Texture mTexture; // page-flip thread (currently main thread) bool mSecure; // no screenshots Loading services/surfaceflinger/RenderEngine/Description.cpp +6 −19 Original line number Diff line number Diff line Loading @@ -31,12 +31,11 @@ Description::Description() : mPlaneAlpha = 1.0f; mPremultipliedAlpha = true; mOpaque = true; mTextureTarget = GL_TEXTURE_EXTERNAL_OES; mTextureEnabled = false; const GLfloat m[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; memset(mColor, 0, sizeof(mColor)); memcpy(mProjectionMatrix, m, sizeof(mProjectionMatrix)); memcpy(mTextureMatrix, m, sizeof(mTextureMatrix)); } Description::~Description() { Loading @@ -61,21 +60,14 @@ void Description::setOpaque(bool opaque) { } } void Description::setTextureName(GLenum target, GLuint tname) { if (target != mTextureTarget) { mTextureTarget = target; } if (tname != mTextureName) { mTextureName = tname; void Description::setTexture(const Texture& texture) { mTexture = texture; mTextureEnabled = true; mUniformsDirty = true; } } void Description::disableTexture() { if (mTextureTarget != 0) { mTextureTarget = 0; } mTextureName = 0; mTextureEnabled = false; } void Description::setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { Loading @@ -91,9 +83,4 @@ void Description::setProjectionMatrix(GLfloat const* mtx) { mUniformsDirty = true; } void Description::setTextureMatrix(GLfloat const* mtx) { memcpy(mTextureMatrix, mtx, sizeof(mTextureMatrix)); mUniformsDirty = true; } } /* namespace android */ services/surfaceflinger/RenderEngine/Description.h +6 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #include <GLES2/gl2.h> #include "Texture.h" #ifndef SF_RENDER_ENGINE_DESCRIPTION_H_ #define SF_RENDER_ENGINE_DESCRIPTION_H_ Loading @@ -40,17 +41,15 @@ class Description { 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(); Loading @@ -59,11 +58,10 @@ public: 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; Loading Loading
services/surfaceflinger/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ LOCAL_SRC_FILES:= \ RenderEngine/ProgramCache.cpp \ RenderEngine/GLExtensions.cpp \ RenderEngine/RenderEngine.cpp \ RenderEngine/Texture.cpp \ RenderEngine/GLES10RenderEngine.cpp \ RenderEngine/GLES11RenderEngine.cpp \ RenderEngine/GLES20RenderEngine.cpp Loading
services/surfaceflinger/Layer.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, { mCurrentCrop.makeInvalid(); mFlinger->getRenderEngine().genTextures(1, &mTextureName); mTexture.init(Texture::TEXTURE_EXTERNAL, mTextureName); uint32_t layerFlags = 0; if (flags & ISurfaceComposerClient::eHidden) Loading Loading @@ -483,7 +484,11 @@ void Layer::onDraw(const sp<const DisplayDevice>& hw, const Region& clip) const mSurfaceFlingerConsumer->getTransformMatrix(textureMatrix); // Set things up for texturing. engine.setupLayerTexturing(mTextureName, useFiltering, textureMatrix); mTexture.setDimensions(mActiveBuffer->getWidth(), mActiveBuffer->getHeight()); mTexture.setFiltering(useFiltering); mTexture.setMatrix(textureMatrix); engine.setupLayerTexturing(mTexture); } else { engine.setupLayerBlackedOut(); } Loading
services/surfaceflinger/Layer.h +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ #include "DisplayHardware/HWComposer.h" #include "DisplayHardware/FloatRect.h" #include "RenderEngine/Mesh.h" #include "RenderEngine/Texture.h" namespace android { Loading Loading @@ -359,6 +360,8 @@ private: bool mNeedsFiltering; // The mesh used to draw the layer in GLES composition mode mutable Mesh mMesh; // The mesh used to draw the layer in GLES composition mode mutable Texture mTexture; // page-flip thread (currently main thread) bool mSecure; // no screenshots Loading
services/surfaceflinger/RenderEngine/Description.cpp +6 −19 Original line number Diff line number Diff line Loading @@ -31,12 +31,11 @@ Description::Description() : mPlaneAlpha = 1.0f; mPremultipliedAlpha = true; mOpaque = true; mTextureTarget = GL_TEXTURE_EXTERNAL_OES; mTextureEnabled = false; const GLfloat m[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 }; memset(mColor, 0, sizeof(mColor)); memcpy(mProjectionMatrix, m, sizeof(mProjectionMatrix)); memcpy(mTextureMatrix, m, sizeof(mTextureMatrix)); } Description::~Description() { Loading @@ -61,21 +60,14 @@ void Description::setOpaque(bool opaque) { } } void Description::setTextureName(GLenum target, GLuint tname) { if (target != mTextureTarget) { mTextureTarget = target; } if (tname != mTextureName) { mTextureName = tname; void Description::setTexture(const Texture& texture) { mTexture = texture; mTextureEnabled = true; mUniformsDirty = true; } } void Description::disableTexture() { if (mTextureTarget != 0) { mTextureTarget = 0; } mTextureName = 0; mTextureEnabled = false; } void Description::setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { Loading @@ -91,9 +83,4 @@ void Description::setProjectionMatrix(GLfloat const* mtx) { mUniformsDirty = true; } void Description::setTextureMatrix(GLfloat const* mtx) { memcpy(mTextureMatrix, mtx, sizeof(mTextureMatrix)); mUniformsDirty = true; } } /* namespace android */
services/surfaceflinger/RenderEngine/Description.h +6 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ #include <GLES2/gl2.h> #include "Texture.h" #ifndef SF_RENDER_ENGINE_DESCRIPTION_H_ #define SF_RENDER_ENGINE_DESCRIPTION_H_ Loading @@ -40,17 +41,15 @@ class Description { 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(); Loading @@ -59,11 +58,10 @@ public: 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; Loading