summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/EffectLayer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/surfaceflinger/EffectLayer.cpp b/services/surfaceflinger/EffectLayer.cpp
index cc85352dc7..e8c590e3c4 100644
--- a/services/surfaceflinger/EffectLayer.cpp
+++ b/services/surfaceflinger/EffectLayer.cpp
@@ -114,7 +114,13 @@ void EffectLayer::preparePerFrameCompositionState() {
}
sp<compositionengine::LayerFE> EffectLayer::getCompositionEngineLayerFE() const {
- return asLayerFE();
+ // There's no need to get a CE Layer if the EffectLayer isn't going to draw anything. In that
+ // case, it acts more like a ContainerLayer so returning a null CE Layer makes more sense
+ if (hasSomethingToDraw()) {
+ return asLayerFE();
+ } else {
+ return nullptr;
+ }
}
compositionengine::LayerFECompositionState* EffectLayer::editCompositionState() {