diff options
author | Dan Stoza <stoza@google.com> | 2016-09-15 16:38:42 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2016-09-15 16:41:53 -0700 |
commit | 5df47cb648a6911dd62527901bb209fd65c73bed (patch) | |
tree | 294d3154578def8cb56655b720218b68153e23c1 | |
parent | 186c4c93a7d35d14dd5e6a6850f2cb884c31db79 (diff) | |
download | native-5df47cb648a6911dd62527901bb209fd65c73bed.tar.gz |
HWC2On1: Fall back to GLES for SolidColor
Even though SolidColor layers map cleanly to HWC_BACKGROUND composition
in HWC1, SurfaceFlinger never used HWC_BACKGROUND, so we can't trust
that HWC1 devices implemented it correctly. To preserve backwards
compatibility, this changes the behavior to fall back to client
composition to minimize incompatibilities with existing devices.
Bug: 30479781
Change-Id: I638339062e03f2c057b3e1624e7157587ddee7ec
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp b/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp index 8bcee39b9d..cc0dfb0945 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp +++ b/services/surfaceflinger/DisplayHardware/HWC2On1Adapter.cpp @@ -2305,7 +2305,14 @@ void HWC2On1Adapter::Layer::applyCompositionType(hwc_layer_1_t& hwc1Layer, hwc1Layer.compositionType = HWC_FRAMEBUFFER; break; case Composition::SolidColor: - hwc1Layer.compositionType = HWC_BACKGROUND; + // In theory the following line should work, but since the HWC1 + // version of SurfaceFlinger never used HWC_BACKGROUND, HWC1 + // devices may not work correctly. To be on the safe side, we + // fall back to client composition. + // + // hwc1Layer.compositionType = HWC_BACKGROUND; + hwc1Layer.compositionType = HWC_FRAMEBUFFER; + hwc1Layer.flags |= HWC_SKIP_LAYER; break; case Composition::Cursor: hwc1Layer.compositionType = HWC_FRAMEBUFFER; |