Merge "Update the global light position based on the rotation of the surface." into tm-dev am: 5a79258c64

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17452927

Change-Id: I223b51575cf84b7c8a1330e6b34e250af69a1d51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Derek Sollenberger
2022-03-30 13:22:45 +00:00
committed by Automerger Merge Worker

View File

@@ -74,7 +74,15 @@ bool SkiaVulkanPipeline::draw(const Frame& frame, const SkRect& screenDirty, con
if (backBuffer.get() == nullptr) {
return false;
}
LightingInfo::updateLighting(lightGeometry, lightInfo);
// update the coordinates of the global light position based on surface rotation
SkPoint lightCenter = mVkSurface->getCurrentPreTransform().mapXY(lightGeometry.center.x,
lightGeometry.center.y);
LightGeometry localGeometry = lightGeometry;
localGeometry.center.x = lightCenter.fX;
localGeometry.center.y = lightCenter.fY;
LightingInfo::updateLighting(localGeometry, lightInfo);
renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, backBuffer,
mVkSurface->getCurrentPreTransform());