当前位置:网站首页>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 += \边栏推荐
- 蓝桥杯单片机省赛第七届
- Is the product of cancer prevention medical insurance safe?
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- Go language naming specification
- 《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
- MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
- Failed to upgrade schema, error: “file does not exist
- 文档声明与字符编码
- Wpviewpdf Delphi and Net PDF viewing component
- [Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
猜你喜欢

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

Set vscode. When double clicking, the selected string includes the $symbol - convenient for PHP operation

Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)

PIP installation of third-party libraries

How much is the tuition fee of SCM training class? How long is the study time?

手撕——排序

Www2022 | know your way back: self training method of graph neural network under distribution and migration
![[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network](/img/11/4a8b52603e6e14a1ed6da1264dee57.png)
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network

Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface

【leetcode】34. Find the first and last positions of elements in a sorted array
随机推荐
Suggestions on settlement solution of u standard contract position explosion
The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Vite: scaffold assembly
Hand tear - sort
软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
pip 安装第三方库
Didi open source Delta: AI developers can easily train natural language models
【小技巧】使用matlab GUI以对话框模式读取文件
Flutter中深入了解MaterialApp,常用属性解析
Learn more about materialapp and common attribute parsing in fluent
集成底座方案演示说明
Fourier series
Go function
66.qt quick-qml自定义日历组件(支持竖屏和横屏)
The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup
Monkey测试
Three ways for programmers to learn PHP easily and put chaos out of order
手撕——排序
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)