Loading services/surfaceflinger/RenderEngine/Description.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ Description::Description() : mOpaque = true; 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)); } Description::~Description() { Loading Loading @@ -78,8 +76,8 @@ void Description::setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf mUniformsDirty = true; } void Description::setProjectionMatrix(GLfloat const* mtx) { memcpy(mProjectionMatrix, mtx, sizeof(mProjectionMatrix)); void Description::setProjectionMatrix(const mat4& mtx) { mProjectionMatrix = mtx; mUniformsDirty = true; } Loading services/surfaceflinger/RenderEngine/Description.h +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ class Description { // color used when texturing is disabled GLclampf mColor[4]; // projection matrix GLfloat mProjectionMatrix[16]; mat4 mProjectionMatrix; public: Description(); Loading @@ -61,7 +61,7 @@ public: void setTexture(const Texture& texture); void disableTexture(); void setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void setProjectionMatrix(GLfloat const* mtx); void setProjectionMatrix(const mat4& mtx); private: bool mUniformsDirty; Loading services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ void GLES11RenderEngine::setupLayerTexturing(const Texture& texture) { glTexParameterx(target, GL_TEXTURE_MAG_FILTER, filter); glTexParameterx(target, GL_TEXTURE_MIN_FILTER, filter); glMatrixMode(GL_TEXTURE); glLoadMatrixf(texture.getMatrix()); glLoadMatrixf(texture.getMatrix().asArray()); glMatrixMode(GL_MODELVIEW); glDisable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_EXTERNAL_OES); Loading services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp +3 −19 Original line number Diff line number Diff line Loading @@ -76,25 +76,9 @@ size_t GLES20RenderEngine::getMaxViewportDims() const { void GLES20RenderEngine::setViewportAndProjection( size_t vpw, size_t vph, size_t w, size_t h, bool yswap) { struct ortho { inline void operator() (GLfloat *m, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far) const { memset(m, 0, 16*sizeof(GLfloat)); m[ 0] = 2.0f / (right - left); m[ 5] = 2.0f / (top - bottom); m[10] =-2.0f / (far - near); m[15] = 1.0f; m[12] = -(right + left) / (right - left); m[13] = -(top + bottom) / (top - bottom); m[14] = -(far + near) / (far - near); } } ortho; GLfloat m[16]; if (yswap) ortho(m, 0, w, h, 0, 0, 1); else ortho(m, 0, w, 0, h, 0, 1); mat4 m; if (yswap) m = mat4::ortho(0, w, h, 0, 0, 1); else m = mat4::ortho(0, w, 0, h, 0, 1); glViewport(0, 0, vpw, vph); mState.setProjectionMatrix(m); Loading services/surfaceflinger/RenderEngine/Program.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ void Program::setUniforms(const Description& desc) { if (mSamplerLoc >= 0) { glUniform1i(mSamplerLoc, 0); glUniformMatrix4fv(mTextureMatrixLoc, 1, GL_FALSE, desc.mTexture.getMatrix()); glUniformMatrix4fv(mTextureMatrixLoc, 1, GL_FALSE, desc.mTexture.getMatrix().asArray()); } if (mAlphaPlaneLoc >= 0) { glUniform1f(mAlphaPlaneLoc, desc.mPlaneAlpha); Loading @@ -138,7 +138,7 @@ void Program::setUniforms(const Description& desc) { glUniform4fv(mColorLoc, 1, desc.mColor); } // these uniforms are always present glUniformMatrix4fv(mProjectionMatrixLoc, 1, GL_FALSE, desc.mProjectionMatrix); glUniformMatrix4fv(mProjectionMatrixLoc, 1, GL_FALSE, desc.mProjectionMatrix.asArray()); } } /* namespace android */ Loading
services/surfaceflinger/RenderEngine/Description.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -33,9 +33,7 @@ Description::Description() : mOpaque = true; 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)); } Description::~Description() { Loading Loading @@ -78,8 +76,8 @@ void Description::setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf mUniformsDirty = true; } void Description::setProjectionMatrix(GLfloat const* mtx) { memcpy(mProjectionMatrix, mtx, sizeof(mProjectionMatrix)); void Description::setProjectionMatrix(const mat4& mtx) { mProjectionMatrix = mtx; mUniformsDirty = true; } Loading
services/surfaceflinger/RenderEngine/Description.h +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ class Description { // color used when texturing is disabled GLclampf mColor[4]; // projection matrix GLfloat mProjectionMatrix[16]; mat4 mProjectionMatrix; public: Description(); Loading @@ -61,7 +61,7 @@ public: void setTexture(const Texture& texture); void disableTexture(); void setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void setProjectionMatrix(GLfloat const* mtx); void setProjectionMatrix(const mat4& mtx); private: bool mUniformsDirty; Loading
services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ void GLES11RenderEngine::setupLayerTexturing(const Texture& texture) { glTexParameterx(target, GL_TEXTURE_MAG_FILTER, filter); glTexParameterx(target, GL_TEXTURE_MIN_FILTER, filter); glMatrixMode(GL_TEXTURE); glLoadMatrixf(texture.getMatrix()); glLoadMatrixf(texture.getMatrix().asArray()); glMatrixMode(GL_MODELVIEW); glDisable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_EXTERNAL_OES); Loading
services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp +3 −19 Original line number Diff line number Diff line Loading @@ -76,25 +76,9 @@ size_t GLES20RenderEngine::getMaxViewportDims() const { void GLES20RenderEngine::setViewportAndProjection( size_t vpw, size_t vph, size_t w, size_t h, bool yswap) { struct ortho { inline void operator() (GLfloat *m, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far) const { memset(m, 0, 16*sizeof(GLfloat)); m[ 0] = 2.0f / (right - left); m[ 5] = 2.0f / (top - bottom); m[10] =-2.0f / (far - near); m[15] = 1.0f; m[12] = -(right + left) / (right - left); m[13] = -(top + bottom) / (top - bottom); m[14] = -(far + near) / (far - near); } } ortho; GLfloat m[16]; if (yswap) ortho(m, 0, w, h, 0, 0, 1); else ortho(m, 0, w, 0, h, 0, 1); mat4 m; if (yswap) m = mat4::ortho(0, w, h, 0, 0, 1); else m = mat4::ortho(0, w, 0, h, 0, 1); glViewport(0, 0, vpw, vph); mState.setProjectionMatrix(m); Loading
services/surfaceflinger/RenderEngine/Program.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ void Program::setUniforms(const Description& desc) { if (mSamplerLoc >= 0) { glUniform1i(mSamplerLoc, 0); glUniformMatrix4fv(mTextureMatrixLoc, 1, GL_FALSE, desc.mTexture.getMatrix()); glUniformMatrix4fv(mTextureMatrixLoc, 1, GL_FALSE, desc.mTexture.getMatrix().asArray()); } if (mAlphaPlaneLoc >= 0) { glUniform1f(mAlphaPlaneLoc, desc.mPlaneAlpha); Loading @@ -138,7 +138,7 @@ void Program::setUniforms(const Description& desc) { glUniform4fv(mColorLoc, 1, desc.mColor); } // these uniforms are always present glUniformMatrix4fv(mProjectionMatrixLoc, 1, GL_FALSE, desc.mProjectionMatrix); glUniformMatrix4fv(mProjectionMatrixLoc, 1, GL_FALSE, desc.mProjectionMatrix.asArray()); } } /* namespace android */