当前位置:网站首页>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 += \边栏推荐
- Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
- Hands on deep learning (II) -- multi layer perceptron
- 5G时代全面到来,浅谈移动通信的前世今生
- 集成底座方案演示说明
- go 函数
- 2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
- 【小技巧】使用matlab GUI以对话框模式读取文件
- It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
- Lost a few hairs, and finally learned - graph traversal -dfs and BFS
- Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
猜你喜欢

The first practical project of software tester: web side (video tutorial + document + use case library)

Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs

C language: examples of logical operation and judgment selection structure

Installation and use of blue lake

Basic operations of MySQL database (based on tables)

Go language introduction

滴滴开源DELTA:AI开发者可轻松训练自然语言模型

The 11th Blue Bridge Cup single chip microcomputer provincial competition

Hand tear - sort

Failed to upgrade schema, error: “file does not exist
随机推荐
go 包的使用
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
Vite: configure IP access
如何解决在editor模式下 无法删除物体的问题
How to model noise data? Hong Kong Baptist University's latest review paper on "label noise representation learning" comprehensively expounds the data, objective function and optimization strategy of
[untitled]
Fourier series
JVM knowledge points
《动手学深度学习》(二)-- 多层感知机
【leetcode】34. Find the first and last positions of elements in a sorted array
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
Go variables and constants
The original author is out! Faker. JS has been controlled by the community..
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Installation and use of blue lake
The 10th Blue Bridge Cup single chip microcomputer provincial competition
蓝湖的安装及使用
The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
2022-07-01: at the annual meeting of a company, everyone is going to play a game of giving bonuses. There are a total of N employees. Each employee has construction points and trouble points. They nee