当前位置:网站首页>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 += \边栏推荐
- Lei Jun wrote a blog when he was a programmer. It's awesome
- 整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
- BiShe cinema ticket purchasing system based on SSM
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- Déchirure à la main - tri
- Failed to upgrade schema, error: “file does not exist
- How to solve the problem that objects cannot be deleted in Editor Mode
- Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
- Demonstration description of integrated base scheme
- LxC limits the number of CPUs
猜你喜欢

First acquaintance with P4 language

Hand tear - sort
![[untitled]](/img/53/cb61622cfcc73a347d2d5e852a5421.jpg)
[untitled]

The first practical project of software tester: web side (video tutorial + document + use case library)
![[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)](/img/5e/81e613370c808c63665c14298f9a39.png)
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)

【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真

Basic operations of MySQL database (based on tables)

The 6th Blue Bridge Cup single chip microcomputer provincial competition

【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!

手撕——排序
随机推荐
go 分支与循环
Www 2022 | rethinking the knowledge map completion of graph convolution network
JVM knowledge points
[tips] use Matlab GUI to read files in dialog mode
Force buckle 540 A single element in an ordered array
Opencv learning example code 3.2.4 LUT
【leetcode】34. Find the first and last positions of elements in a sorted array
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
【小技巧】使用matlab GUI以对话框模式读取文件
Raspberry pie GPIO pin controls traffic light and buzzer
Blue Bridge Cup SCM digital tube skills
蓝湖的安装及使用
如何解决在editor模式下 无法删除物体的问题
蓝桥杯单片机省赛第七届
How to solve the problem that objects cannot be deleted in Editor Mode
QT designer plug-in implementation of QT plug-in
接口调试工具模拟Post上传文件——ApiPost
Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
Target free or target specific: a simple and effective zero sample position detection comparative learning method
"No war on the Western Front" we just began to love life, but we had to shoot at everything