surfaceflinger: fix fillRegionWithColor
This was regressed by commit 1be50b50ab, where vertices were assumed
to be in Vulkan coordinate convention.
Bug: 114439058
Test: hide cutout
Change-Id: I0eafa61cb83c8a682d74d869cd3736b63f393d31
diff --git a/services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp b/services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp
index 7121cc2..0f0ff62 100644
--- a/services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/gl/GLES20RenderEngine.cpp
@@ -539,25 +539,25 @@
glClear(GL_COLOR_BUFFER_BIT);
}
-void GLES20RenderEngine::fillRegionWithColor(const Region& region, uint32_t height, float red,
- float green, float blue, float alpha) {
+void GLES20RenderEngine::fillRegionWithColor(const Region& region, float red, float green,
+ float blue, float alpha) {
size_t c;
Rect const* r = region.getArray(&c);
Mesh mesh(Mesh::TRIANGLES, c * 6, 2);
Mesh::VertexArray<vec2> position(mesh.getPositionArray<vec2>());
for (size_t i = 0; i < c; i++, r++) {
position[i * 6 + 0].x = r->left;
- position[i * 6 + 0].y = height - r->top;
+ position[i * 6 + 0].y = r->top;
position[i * 6 + 1].x = r->left;
- position[i * 6 + 1].y = height - r->bottom;
+ position[i * 6 + 1].y = r->bottom;
position[i * 6 + 2].x = r->right;
- position[i * 6 + 2].y = height - r->bottom;
+ position[i * 6 + 2].y = r->bottom;
position[i * 6 + 3].x = r->left;
- position[i * 6 + 3].y = height - r->top;
+ position[i * 6 + 3].y = r->top;
position[i * 6 + 4].x = r->right;
- position[i * 6 + 4].y = height - r->bottom;
+ position[i * 6 + 4].y = r->bottom;
position[i * 6 + 5].x = r->right;
- position[i * 6 + 5].y = height - r->top;
+ position[i * 6 + 5].y = r->top;
}
setupFillWithColor(red, green, blue, alpha);
drawMesh(mesh);