当前位置:网站首页>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 += \边栏推荐
- 近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
- Didi open source Delta: AI developers can easily train natural language models
- Installation and use of blue lake
- The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- [tips] use Matlab GUI to read files in dialog mode
- [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!
- [source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
- Déchirure à la main - tri
- SQL Yiwen get window function
猜你喜欢

《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮

Hands on deep learning (II) -- multi layer perceptron

潘多拉 IOT 开发板学习(RT-Thread)—— 实验1 LED 闪烁实验(学习笔记)

毕设-基于SSM电影院购票系统

Lost a few hairs, and finally learned - graph traversal -dfs and BFS

Force buckle 540 A single element in an ordered array

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

A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)

Basic operations of MySQL database (based on tables)

Suggestions on settlement solution of u standard contract position explosion
随机推荐
潘多拉 IOT 开发板学习(HAL 库)—— 实验2 蜂鸣器实验(学习笔记)
The 11th Blue Bridge Cup single chip microcomputer provincial competition
Feature Engineering: summary of common feature transformation methods
Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
Wpviewpdf Delphi and Net PDF viewing component
Demonstration description of integrated base scheme
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
Is the product of cancer prevention medical insurance safe?
Flutter中深入了解MaterialApp,常用属性解析
Object oriented thinking
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
Go language introduction
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
The first practical project of software tester: web side (video tutorial + document + use case library)
QT designer plug-in implementation of QT plug-in
藍湖的安裝及使用
XSS prevention
Lei Jun wrote a blog when he was a programmer. It's awesome