summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2019-10-29 18:19:35 -0700
committer Vishnu Nair <vishnun@google.com> 2019-10-30 01:20:41 +0000
commitc97b8dbd9093c7a8cfeedcd7e417f6732cbe24c6 (patch)
tree1851287287ac16f9c978542ca0ef08793a6a2a50 /services/surfaceflinger/SurfaceFlinger.cpp
parent7b3a312f385e1fc8c3694ffeafc18794e96a95f1 (diff)
[Shadows] Add shadow radius to sf layer state (2/n)
Bug: 136561771 Test: atest SurfaceFlinger_Test Change-Id: Icafe852eaad195163b48b802db2a4b092aa30926
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1acb2da051..953cb99c13 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2011,7 +2011,8 @@ void SurfaceFlinger::computeLayerBounds() {
continue;
}
- layer->computeBounds(displayDevice->getViewport().toFloatRect(), ui::Transform());
+ layer->computeBounds(displayDevice->getViewport().toFloatRect(), ui::Transform(),
+ 0.f /* shadowRadius */);
}
}
}
@@ -3335,6 +3336,9 @@ uint32_t SurfaceFlinger::setClientStateLocked(
flags |= eTraversalNeeded;
}
}
+ if (what & layer_state_t::eShadowRadiusChanged) {
+ if (layer->setShadowRadius(s.shadowRadius)) flags |= eTraversalNeeded;
+ }
// This has to happen after we reparent children because when we reparent to null we remove
// child layers from current state and remove its relative z. If the children are reparented in
// the same transaction, then we have to make sure we reparent the children first so we do not
@@ -5010,7 +5014,8 @@ status_t SurfaceFlinger::captureLayers(
const Rect& drawingBounds)
: oldParent(oldParent), newParent(newParent) {
// Compute and cache the bounds for the new parent layer.
- newParent->computeBounds(drawingBounds.toFloatRect(), ui::Transform());
+ newParent->computeBounds(drawingBounds.toFloatRect(), ui::Transform(),
+ 0.f /* shadowRadius */);
oldParent->setChildrenDrawingParent(newParent);
}
~ReparentForDrawing() { oldParent->setChildrenDrawingParent(oldParent); }