当前位置:网站首页>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 += \
边栏推荐
- 蓝湖的安装及使用
- go 变量与常量
- Sword finger offer II 006 Sort the sum of two numbers in the array
- 蓝桥杯单片机省赛第八届
- 蓝桥杯单片机省赛第五届
- XSS prevention
- QT designer plug-in implementation of QT plug-in
- Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
- 初识string+简单用法(二)
- Didi open source Delta: AI developers can easily train natural language models
猜你喜欢
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Introduction to vmware workstation and vSphere
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
Learn more about materialapp and common attribute parsing in fluent
一文彻底理解评分卡开发中——Y的确定(Vintage分析、滚动率分析等)
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
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
PIP installation of third-party libraries
The 9th Blue Bridge Cup single chip microcomputer provincial competition
随机推荐
Use a mask to restrict the input of the qlineedit control
Jetpack之LiveData扩展MediatorLiveData
蓝桥杯单片机省赛第五届
WPViewPDF Delphi 和 .NET 的 PDF 查看组件
Jetpack's livedata extension mediatorlivedata
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
【leetcode】34. Find the first and last positions of elements in a sorted array
Visual slam Lecture 3 -- Lie groups and Lie Algebras
Basic operations of MySQL database (based on tables)
近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
Opencv learning example code 3.2.4 LUT
[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!
L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
JVM知识点
JVM knowledge points
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
Installation et utilisation du lac bleu
Which product of anti-cancer insurance is better?