当前位置:网站首页>LCM of Spreadtrum platform rotates 180 °
LCM of Spreadtrum platform rotates 180 °
2022-07-02 04:03:00 【I bought GA 008】
When lcm When the chip does not support image rotation , The platform needs to be modified .
route :frameworks//native/services/surfaceflinger/SurfaceFlinger.cpp
diff --git a/native/services/surfaceflinger/SurfaceFlinger.cpp b/native/services/surfaceflinger/SurfaceFlinger.cpp
index 09bd38f..2b1c820 100644
--- a/native/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/native/services/surfaceflinger/SurfaceFlinger.cpp
@@ -361,7 +361,7 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
useContextPriority = use_context_priority(true);
using Values = SurfaceFlingerProperties::primary_display_orientation_values;
- switch (primary_display_orientation(Values::ORIENTATION_0)) {
+ switch (primary_display_orientation(Values::ORIENTATION_180)) {
case Values::ORIENTATION_0:
break;
case Values::ORIENTATION_90:
@@ -5519,6 +5519,9 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& displayToken,
ATRACE_CALL();
if (!displayToken) return BAD_VALUE;
+ if (internalDisplayOrientation != ui::ROTATION_0) {
+ rotation = rotation + internalDisplayOrientation; // Adapt to ordinary mobile phone screenshots
+ }
auto renderAreaRotation = ui::Transform::toRotationFlags(rotation);
if (renderAreaRotation == ui::Transform::ROT_INVALID) {
@@ -5616,14 +5619,20 @@ status_t SurfaceFlinger::captureScreen(uint64_t displayOrLayerStack, Dataspace*
width = uint32_t(display->getViewport().width());
height = uint32_t(display->getViewport().height());
- const auto orientation = display->getOrientation();
+ auto orientation = display->getOrientation();
captureOrientation = ui::Transform::toRotationFlags(orientation);
+ if (internalDisplayOrientation != ui::ROTATION_0) {
+ orientation = orientation + internalDisplayOrientation;
+ captureOrientation = ui::Transform::toRotationFlags(orientation); // To adapt to adb screenshots
+ }
switch (captureOrientation) {
case ui::Transform::ROT_90:
captureOrientation = ui::Transform::ROT_270;
break;
-
+ case ui::Transform::ROT_180:
+ captureOrientation = ui::Transform::ROT_180;
+ break;
case ui::Transform::ROT_270:
captureOrientation = ui::Transform::ROT_90;
break;
route :device/sprd/mpool/module/gpu/main.mk
diff --git a/module/gpu/main.mk b/module/gpu/main.mk
index 8514e3af..26f9de80 100644
--- a/module/gpu/main.mk
+++ b/module/gpu/main.mk
@@ -24,7 +24,7 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
ro.surface_flinger.use_vr_flinger=false \
ro.surface_flinger.max_frame_buffer_acquired_buffers=3 \
ro.surface_flinger.start_graphics_allocator_service=false \
- ro.surface_flinger.primary_display_orientation=ORIENTATION_0
+ ro.surface_flinger.primary_display_orientation=ORIENTATION_180
# Memtack HAL
PRODUCT_PACKAGES += \
边栏推荐
- Vite: scaffold assembly
- Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
- [JS event -- event flow]
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- Hands on deep learning (II) -- multi layer perceptron
- Opencv learning example code 3.2.4 LUT
- 《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
- 5G時代全面到來,淺談移動通信的前世今生
- Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
- Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
猜你喜欢
Lei Jun wrote a blog when he was a programmer. It's awesome
Delete the code you wrote? Sentenced to 10 months!
蓝桥杯单片机第六届温度记录器
初识P4语言
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
初识string+简单用法(二)
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
接口调试工具模拟Post上传文件——ApiPost
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
随机推荐
Learn more about materialapp and common attribute parsing in fluent
How to solve the code error when storing array data into the database
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
滴滴开源DELTA:AI开发者可轻松训练自然语言模型
《动手学深度学习》(二)-- 多层感知机
The confusion I encountered when learning stm32
Jetpack之LiveData扩展MediatorLiveData
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
MySQL advanced SQL statement 2
The 9th Blue Bridge Cup single chip microcomputer provincial competition
【leetcode】81. Search rotation sort array II
Hand tear - sort
go 分支与循环
go 变量与常量
PR zero foundation introductory guide note 2
蓝桥杯单片机第六届温度记录器
Three ways for programmers to learn PHP easily and put chaos out of order
Visual slam Lecture 3 -- Lie groups and Lie Algebras
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
XSS prevention