summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2019-11-16 07:37:09 -0800
committer Vishnu Nair <vishnun@google.com> 2019-11-16 07:37:09 -0800
commitf37dcfbe941bb5f0a55aa30ccb7ba9321df6aa24 (patch)
treeeb9819c31fd0c9f9107396bd71d59d23f68926ed
parente6d829d9688dabb230329d1c9b291906a745ad55 (diff)
Initialize shadowRadius state
The uninitialized var was causing the device to incorrectly going into glcomp. Fixes: b/144450732 Test: adb shell am instrument -w -e class android.platform.test.scenario.launcher.FlingAllAppsMicrobenchmark android.platform.test.scenario/androidx.test.runner.AndroidJUnitRunner and capture a systrace Change-Id: Ia33a4c8908990cd12fbd5a5ce1664ed96c112832
-rw-r--r--services/surfaceflinger/Layer.cpp1
-rw-r--r--services/surfaceflinger/Layer.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 00d932d705..1d0ce1002d 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -109,6 +109,7 @@ Layer::Layer(const LayerCreationArgs& args)
mCurrentState.hasColorTransform = false;
mCurrentState.colorSpaceAgnostic = false;
mCurrentState.metadata = args.metadata;
+ mCurrentState.shadowRadius = 0.f;
// drawing state & current state are identical
mDrawingState = mCurrentState;
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index bed5ad3dcd..1388612b57 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -950,7 +950,7 @@ private:
// The inherited shadow radius after taking into account the layer hierarchy. This is the
// final shadow radius for this layer. If a shadow is specified for a layer, then effective
// shadow radius is the set shadow radius, otherwise its the parent's shadow radius.
- float mEffectiveShadowRadius;
+ float mEffectiveShadowRadius = 0.f;
// Returns true if the layer can draw shadows on its border.
virtual bool canDrawShadows() const { return true; }