当前位置:网站首页>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
- 【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
- 近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
- Typescript practice for SAP ui5
- Failed to upgrade schema, error: “file does not exist
- 【小技巧】使用matlab GUI以对话框模式读取文件
- Sword finger offer II 006 Sort the sum of two numbers in the array
- Didi open source Delta: AI developers can easily train natural language models
- 滴滴开源DELTA:AI开发者可轻松训练自然语言模型
- Hand tear - sort
猜你喜欢

手撕——排序

PR zero foundation introductory guide note 2

PIP installation of third-party libraries

Demonstration description of integrated base scheme

0基础如何学习自动化测试?按照这7步一步一步来学习就成功了

pip 安装第三方库

Qt插件之Qt Designer插件实现

MySQL advanced SQL statement 2

u本位合约爆仓清算解决方案建议

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
随机推荐
一文彻底理解评分卡开发中——Y的确定(Vintage分析、滚动率分析等)
The 5th Blue Bridge Cup single chip microcomputer provincial competition
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
毕设-基于SSM电影院购票系统
Yyds dry inventory compiler and compiler tools
Failed to upgrade schema, error: “file does not exist
藍湖的安裝及使用
【leetcode】81. Search rotation sort array II
Oracle common SQL
Where can I buy cancer insurance? Which product is better?
What is 5g industrial wireless gateway? What functions can 5g industrial wireless gateway achieve?
Fingertips life Chapter 4 modules and packages
《动手学深度学习》(二)-- 多层感知机
Influence of air resistance on the trajectory of table tennis
MD5 of Oracle
Fluent icon demo
Go语言介绍
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
Object oriented thinking
Blue Bridge Cup single chip microcomputer sixth temperature recorder