Loading libs/gui/GLConsumer.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -834,10 +834,10 @@ void GLConsumer::computeTransformMatrix(float outTransform[16], xform = crop * xform; } // SurfaceFlinger expects the top of its window textures to be at a Y // coordinate of 0, so GLConsumer must behave the same way. We don't // want to expose this to applications, however, so we must add an // additional vertical flip to the transform after all the other transforms. // GLConsumer uses the GL convention where (0, 0) is the bottom-left // corner and (1, 1) is the top-right corner. Add an additional vertical // flip after all other transforms to map from GL convention to buffer // queue memory layout, where (0, 0) is the top-left corner. xform = mtxFlipV * xform; memcpy(outTransform, xform.asArray(), sizeof(xform)); Loading services/surfaceflinger/BufferLayer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT // TODO: we probably want to generate the texture coords with the mesh // here we assume that we only have 4 vertices renderengine::Mesh::VertexArray<vec2> texCoords(getBE().mMesh.getTexCoordArray<vec2>()); // flip texcoords vertically because BufferLayerConsumer expects them to be in GL convention texCoords[0] = vec2(left, 1.0f - top); texCoords[1] = vec2(left, 1.0f - bottom); texCoords[2] = vec2(right, 1.0f - bottom); Loading services/surfaceflinger/DisplayDevice.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -386,8 +386,7 @@ void DisplayDevice::setViewportAndProjection() const { size_t w = mDisplayWidth; size_t h = mDisplayHeight; Rect sourceCrop(0, 0, w, h); mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, h, false, ui::Transform::ROT_0); mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, ui::Transform::ROT_0); } const sp<Fence>& DisplayDevice::getClientTargetAcquireFence() const { Loading services/surfaceflinger/Layer.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -748,7 +748,6 @@ void Layer::computeGeometry(const RenderArea& renderArea, renderengine::Mesh& mesh, bool useIdentityTransform) const { const ui::Transform renderAreaTransform(renderArea.getTransform()); const uint32_t height = renderArea.getHeight(); FloatRect win = computeBounds(); vec2 lt = vec2(win.left, win.top); Loading @@ -769,9 +768,6 @@ void Layer::computeGeometry(const RenderArea& renderArea, position[1] = renderAreaTransform.transform(lb); position[2] = renderAreaTransform.transform(rb); position[3] = renderAreaTransform.transform(rt); for (size_t i = 0; i < 4; i++) { position[i].y = height - position[i].y; } } bool Layer::isSecure() const { Loading services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp +9 −11 Original line number Diff line number Diff line Loading @@ -202,21 +202,15 @@ void GLES20RenderEngine::bindExternalTextureImage(uint32_t texName, } void GLES20RenderEngine::setViewportAndProjection(size_t vpw, size_t vph, Rect sourceCrop, size_t hwh, bool yswap, ui::Transform::orientation_flags rotation) { int32_t l = sourceCrop.left; int32_t r = sourceCrop.right; // In GL, (0, 0) is the bottom-left corner, so flip y coordinates int32_t t = hwh - sourceCrop.top; int32_t b = hwh - sourceCrop.bottom; mat4 m; if (yswap) { m = mat4::ortho(l, r, t, b, 0, 1); } else { m = mat4::ortho(l, r, b, t, 0, 1); int32_t b = sourceCrop.bottom; int32_t t = sourceCrop.top; if (mRenderToFbo) { std::swap(t, b); } mat4 m = mat4::ortho(l, r, b, t, 0, 1); // Apply custom rotation to the projection. float rot90InRadians = 2.0f * static_cast<float>(M_PI) / 4.0f; Loading Loading @@ -326,9 +320,13 @@ void GLES20RenderEngine::bindImageAsFramebuffer(EGLImageKHR image, uint32_t* tex *status = glCheckFramebufferStatus(GL_FRAMEBUFFER); *texName = tname; *fbName = name; mRenderToFbo = true; } void GLES20RenderEngine::unbindFramebuffer(uint32_t texName, uint32_t fbName) { mRenderToFbo = false; glBindFramebuffer(GL_FRAMEBUFFER, 0); glDeleteFramebuffers(1, &fbName); glDeleteTextures(1, &texName); Loading Loading
libs/gui/GLConsumer.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -834,10 +834,10 @@ void GLConsumer::computeTransformMatrix(float outTransform[16], xform = crop * xform; } // SurfaceFlinger expects the top of its window textures to be at a Y // coordinate of 0, so GLConsumer must behave the same way. We don't // want to expose this to applications, however, so we must add an // additional vertical flip to the transform after all the other transforms. // GLConsumer uses the GL convention where (0, 0) is the bottom-left // corner and (1, 1) is the top-right corner. Add an additional vertical // flip after all other transforms to map from GL convention to buffer // queue memory layout, where (0, 0) is the top-left corner. xform = mtxFlipV * xform; memcpy(outTransform, xform.asArray(), sizeof(xform)); Loading
services/surfaceflinger/BufferLayer.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ void BufferLayer::drawWithOpenGL(const RenderArea& renderArea, bool useIdentityT // TODO: we probably want to generate the texture coords with the mesh // here we assume that we only have 4 vertices renderengine::Mesh::VertexArray<vec2> texCoords(getBE().mMesh.getTexCoordArray<vec2>()); // flip texcoords vertically because BufferLayerConsumer expects them to be in GL convention texCoords[0] = vec2(left, 1.0f - top); texCoords[1] = vec2(left, 1.0f - bottom); texCoords[2] = vec2(right, 1.0f - bottom); Loading
services/surfaceflinger/DisplayDevice.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -386,8 +386,7 @@ void DisplayDevice::setViewportAndProjection() const { size_t w = mDisplayWidth; size_t h = mDisplayHeight; Rect sourceCrop(0, 0, w, h); mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, h, false, ui::Transform::ROT_0); mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, ui::Transform::ROT_0); } const sp<Fence>& DisplayDevice::getClientTargetAcquireFence() const { Loading
services/surfaceflinger/Layer.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -748,7 +748,6 @@ void Layer::computeGeometry(const RenderArea& renderArea, renderengine::Mesh& mesh, bool useIdentityTransform) const { const ui::Transform renderAreaTransform(renderArea.getTransform()); const uint32_t height = renderArea.getHeight(); FloatRect win = computeBounds(); vec2 lt = vec2(win.left, win.top); Loading @@ -769,9 +768,6 @@ void Layer::computeGeometry(const RenderArea& renderArea, position[1] = renderAreaTransform.transform(lb); position[2] = renderAreaTransform.transform(rb); position[3] = renderAreaTransform.transform(rt); for (size_t i = 0; i < 4; i++) { position[i].y = height - position[i].y; } } bool Layer::isSecure() const { Loading
services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp +9 −11 Original line number Diff line number Diff line Loading @@ -202,21 +202,15 @@ void GLES20RenderEngine::bindExternalTextureImage(uint32_t texName, } void GLES20RenderEngine::setViewportAndProjection(size_t vpw, size_t vph, Rect sourceCrop, size_t hwh, bool yswap, ui::Transform::orientation_flags rotation) { int32_t l = sourceCrop.left; int32_t r = sourceCrop.right; // In GL, (0, 0) is the bottom-left corner, so flip y coordinates int32_t t = hwh - sourceCrop.top; int32_t b = hwh - sourceCrop.bottom; mat4 m; if (yswap) { m = mat4::ortho(l, r, t, b, 0, 1); } else { m = mat4::ortho(l, r, b, t, 0, 1); int32_t b = sourceCrop.bottom; int32_t t = sourceCrop.top; if (mRenderToFbo) { std::swap(t, b); } mat4 m = mat4::ortho(l, r, b, t, 0, 1); // Apply custom rotation to the projection. float rot90InRadians = 2.0f * static_cast<float>(M_PI) / 4.0f; Loading Loading @@ -326,9 +320,13 @@ void GLES20RenderEngine::bindImageAsFramebuffer(EGLImageKHR image, uint32_t* tex *status = glCheckFramebufferStatus(GL_FRAMEBUFFER); *texName = tname; *fbName = name; mRenderToFbo = true; } void GLES20RenderEngine::unbindFramebuffer(uint32_t texName, uint32_t fbName) { mRenderToFbo = false; glBindFramebuffer(GL_FRAMEBUFFER, 0); glDeleteFramebuffers(1, &fbName); glDeleteTextures(1, &texName); Loading