当前位置:网站首页>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 += \
边栏推荐
- Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
- Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
- Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
- 5G時代全面到來,淺談移動通信的前世今生
- 手撕——排序
- Typescript practice for SAP ui5
- Use of go package
- 【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
- go 函数
- 蓝桥杯单片机省赛第七届
猜你喜欢
Vite: configure IP access
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
Go language introduction
[JS event -- event flow]
Basic operations of MySQL database (based on tables)
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
0基础如何学习自动化测试?按照这7步一步一步来学习就成功了
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
u本位合约爆仓清算解决方案建议
JVM knowledge points
随机推荐
Monkey测试
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
Wpviewpdf Delphi and Net PDF viewing component
BiShe cinema ticket purchasing system based on SSM
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
go 分支与循环
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
How to solve the code error when storing array data into the database
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Influence of air resistance on the trajectory of table tennis
[tips] use Matlab GUI to read files in dialog mode
初识string+简单用法(二)
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
手撕——排序
regular expression
Use of go package
Nacos 配置中心整体设计原理分析(持久化,集群,信息同步)
Vite: scaffold assembly