summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nader Jawad <njawad@google.com> 2022-04-04 22:43:47 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-04-04 22:43:47 +0000
commit0a2322bf8ad19617c01059e35a23ebabdce36f9b (patch)
tree7228612abb0b12b20cdec4bd4f2415e8f3cd6bd0
parent7b763b6a427ea0efdbdd289268d06692efdd2e31 (diff)
parentf0f218dd01c1bab8d383a119ef20e8f46d72d0b9 (diff)
Merge "Update the global light position based on the rotation of the surface." into sc-v2-dev am: f0f218dd01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17539864 Change-Id: Idae2cf9e5b9abf1303b4f7093ef610e0c089fd67 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
index 0e4a1f945b85..99fd463b0660 100644
--- a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
@@ -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());