Disable hwui blending for first draw to main FBO
bug:34809371
In some applications, the first draw is not opaque - either because the
application is misbehaved, or because hwui is not able to reliably tell
whether the layer is opaque or translucent. This is undefined behaviour
in OpenGL ES and has a significant performance and bandwidth impact on
some tiler GPUs as it requires loading the previous frame's color data.
This change disables blending in that case and also for effectively
opaque blend modes (SRC=GL_ONE, DST=GL_ZERO). It increases performance
by ~10% for Leanback CTS on some low-end GPUs (gradient layer that hwui
incorrectly believes to be translucent).
Test: manual - visual inspection on fugu (nexus player)
Change-Id: I2cbf1c76678acae1a36923e72fd18ed55cd89dc2
diff --git a/libs/hwui/renderstate/RenderState.h b/libs/hwui/renderstate/RenderState.h
index df81e86..315fa2d 100644
--- a/libs/hwui/renderstate/RenderState.h
+++ b/libs/hwui/renderstate/RenderState.h
@@ -106,7 +106,7 @@
// more thinking...
void postDecStrong(VirtualLightRefBase* object);
- void render(const Glop& glop, const Matrix4& orthoMatrix);
+ void render(const Glop& glop, const Matrix4& orthoMatrix, bool overrideDisableBlending);
Blend& blend() { return *mBlend; }
MeshState& meshState() { return *mMeshState; }