How to change the display Orientation in Android 10 hdmi port

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change the display Orientation in Android 10 hdmi port

535 Views
subash_p
Contributor III

Hi,

I am working on an i.MX8MP custom board with Android 10_2.3.0. I am trying to change the display orientation from landscape to portrait in my Android image, so I added the following changes in my .mk files.

diff --git a/imx8m/BoardConfigCommon.mk b/imx8m/BoardConfigCommon.mk
index 92197b61..2b105592 100644
--- a/imx8m/BoardConfigCommon.mk
+++ b/imx8m/BoardConfigCommon.mk
@@ -10,7 +10,10 @@ HAVE_FSL_IMX_IPU \
PREBUILT_FSL_IMX_GPU \
BOARD_SOC_TYPE \
PRODUCT_MANUFACTURER \
-BOARD_VPU_ONLY
+BOARD_VPU_ONLY \
+SF_PRIMARY_DISPLAY_ORIENTATION
+
+SOONG_CONFIG_IMXPLUGIN_SF_PRIMARY_DISPLAY_ORIENTATION = 270

SOONG_CONFIG_IMXPLUGIN_BOARD_PLATFORM = imx8
SOONG_CONFIG_IMXPLUGIN_NUM_FRAMEBUFFER_SURFACE_BUFFERS = 3
diff --git a/imx8m/evk_8mm/BoardConfig.mk b/imx8m/evk_8mm/BoardConfig.mk
index ed30f771..cd8f4c89 100644
--- a/imx8m/evk_8mm/BoardConfig.mk
+++ b/imx8m/evk_8mm/BoardConfig.mk
@@ -117,6 +117,8 @@ TARGET_USES_MKE2FS := true
# define frame buffer count
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3

+SF_PRIMARY_DISPLAY_ORIENTATION := 270
+
ifeq ($(PRODUCT_IMX_DRM),true)
CMASIZE=736M
else


When I set SF_PRIMARY_DISPLAY_ORIENTATION := 270, the output appears in

landscape_view_android_10.jpeg

When I set SF_PRIMARY_DISPLAY_ORIENTATION := 180, the output appears in a

portrait_type_view_android_10.jpeg

,but not in the correct orientation. When i passed the 
$ settings put system user_rotation 3 command in android 15 means gives me the correct_portrait_view

correct_portrait_view.jpg

However, this command does not work on Android 11.

I will attach an image showing the orientation I am expecting in Android 10

correct_portrait_view.jpg


Thanks &Regards
Subash.P

 

0 Kudos
Reply
2 Replies

495 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

surfaceflinger rotation information will not pass to HWC in Android10, please try the attachment in HAL and use 'settings put system accelerometer_rotation 0/1' for test.

diff --git a/display/display/Composer.cpp b/display/display/Composer.cpp
old mode 100644
new mode 100755
index 8dba110..282c4f8
--- a/display/display/Composer.cpp
+++ b/display/display/Composer.cpp
@@ -350,11 +350,40 @@ int Composer::clearWormHole(LayerVector& layers)
 
 int Composer::composeLayer(Layer* layer, bool bypass)
 {
+	int transform;
     if (layer == NULL || mTarget == NULL) {
         ALOGE("composeLayer: invalid layer or target");
         return -EINVAL;
     }
 
+
+	/*
+		0 =>     4
+	   4  =>   3
+	   3  =>   7
+	   7  =>   0
+	*/
+	ALOGI("liutest1 composeLayer transform:0x%x\n",layer->transform);
+
+	switch (layer->transform)
+	{
+	case 0:
+		transform = 4;
+		break;
+	case 4:
+		transform = 3;
+		break;
+	case 3:
+		transform = 7;
+		break;
+	case 7:
+		transform = 0;
+		break;
+
+	default:
+		ALOGI("liutest1 invalid transform:0x%x\n",layer->transform);
+	}
+
     if (bypass && layer->isSolidColor()) {
         ALOGV("composeLayer dim layer bypassed");
         return 0;
@@ -392,7 +421,7 @@ int Composer::composeLayer(Layer* layer, bool bypass)
             continue;
         }
 
-        setClipping(srect, drect, clip, layer->transform);
+        setClipping(srect, drect, clip, /*layer->transform*/transform);
         ALOGV("index:%d, i:%d sourceCrop(l:%d,t:%d,r:%d,b:%d), "
              "visible(l:%d,t:%d,r:%d,b:%d), "
              "display(l:%d,t:%d,r:%d,b:%d)", layer->index, (int)i,
@@ -403,8 +432,9 @@ int Composer::composeLayer(Layer* layer, bool bypass)
             ALOGV("zorder:0x%x, layer phys:0x%" PRIx64,
                 layer->zorder, layer->handle->phys);
         }
-        ALOGV("transform:0x%x, blend:0x%x, alpha:0x%x",
-                layer->transform, layer->blendMode, layer->planeAlpha);
+        /*ALOGV*/ALOGI("liutest1 transform:0x%x:0x%x, blend:0x%x, alpha:0x%x",
+                layer->transform,transform, layer->blendMode, layer->planeAlpha);
+
 
         setG2dSurface(dSurfaceX, mTarget, drect);
 
@@ -422,7 +452,7 @@ int Composer::composeLayer(Layer* layer, bool bypass)
             return -EINVAL;
         }
 
-        convertRotation(layer->transform, sSurface, dSurface);
+        convertRotation(/*layer->transform*/transform, sSurface, dSurface);
         if (!bypass) {
             convertBlending(layer->blendMode, sSurface, dSurface);
         }



Best Regards,
Zhiming

0 Kudos
Reply

482 Views
subash_p
Contributor III

Hi @Zhiming_Liu 

After applying your patch, I can see some changes on my screen, but the resolution is not good. Also, when I connect a mouse, it works in the way of landscape navigation, not in portrait navigation. 

And also, the navigation bar is not visible.

a6a427ba-b133-4e1c-9cc8-b7fe694ef852.jpg


Best Regards,
Subash P.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2157311%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20change%20the%20display%20Orientation%20in%20Android%2010%20hdmi%20port%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2157311%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EHi%2C%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EI%20am%20working%20on%20an%20i.MX8MP%20custom%20board%20with%20Android%2010_2.3.0.%20I%20am%20trying%20to%20change%20the%20display%20orientation%20from%20landscape%20to%20portrait%20in%20my%20Android%20image%2C%20so%20I%20added%20the%20following%20changes%20in%20my%20.mk%20files.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Ediff%20--git%20a%2Fimx8m%2FBoardConfigCommon.mk%20b%2Fimx8m%2FBoardConfigCommon.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Eindex%2092197b61..2b105592%20100644%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E---%20a%2Fimx8m%2FBoardConfigCommon.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2B%2B%2B%20b%2Fimx8m%2FBoardConfigCommon.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%40%40%20-10%2C7%20%2B10%2C10%20%40%40%20HAVE_FSL_IMX_IPU%20%5C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EPREBUILT_FSL_IMX_GPU%20%5C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EBOARD_SOC_TYPE%20%5C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EPRODUCT_MANUFACTURER%20%5C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E-BOARD_VPU_ONLY%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2BBOARD_VPU_ONLY%20%5C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2BSF_PRIMARY_DISPLAY_ORIENTATION%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2B%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2BSOONG_CONFIG_IMXPLUGIN_SF_PRIMARY_DISPLAY_ORIENTATION%20%3D%20270%3C%2FFONT%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3ESOONG_CONFIG_IMXPLUGIN_BOARD_PLATFORM%20%3D%20imx8%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3ESOONG_CONFIG_IMXPLUGIN_NUM_FRAMEBUFFER_SURFACE_BUFFERS%20%3D%203%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Ediff%20--git%20a%2Fimx8m%2Fevk_8mm%2FBoardConfig.mk%20b%2Fimx8m%2Fevk_8mm%2FBoardConfig.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Eindex%20ed30f771..cd8f4c89%20100644%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E---%20a%2Fimx8m%2Fevk_8mm%2FBoardConfig.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2B%2B%2B%20b%2Fimx8m%2Fevk_8mm%2FBoardConfig.mk%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%40%40%20-117%2C6%20%2B117%2C8%20%40%40%20TARGET_USES_MKE2FS%20%3A%3D%20true%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%23%20define%20frame%20buffer%20count%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3ENUM_FRAMEBUFFER_SURFACE_BUFFERS%20%3A%3D%203%3C%2FFONT%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2BSF_PRIMARY_DISPLAY_ORIENTATION%20%3A%3D%20270%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2B%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Eifeq%20(%24(PRODUCT_IMX_DRM)%2Ctrue)%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3ECMASIZE%3D736M%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Eelse%3C%2FFONT%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EWhen%20I%20set%20SF_PRIMARY_DISPLAY_ORIENTATION%20%3A%3D%20270%2C%20the%20output%20appears%20in%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22landscape_view_android_10.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22landscape_view_android_10.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F353876i67B29E097B92ABF8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22landscape_view_android_10.jpeg%22%20alt%3D%22landscape_view_android_10.jpeg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EWhen%20I%20set%20SF_PRIMARY_DISPLAY_ORIENTATION%20%3A%3D%20180%2C%20the%20output%20appears%20in%20a%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22portrait_type_view_android_10.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22portrait_type_view_android_10.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F353877i8AF9FEFE953EB1B3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22portrait_type_view_android_10.jpeg%22%20alt%3D%22portrait_type_view_android_10.jpeg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%2Cbut%20not%20in%20the%20correct%20orientation.%20W%3C%2FFONT%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3Ehen%20i%20passed%20the%26nbsp%3B%3CBR%20%2F%3E%24%20settings%20put%20system%20user_rotation%203%20command%26nbsp%3Bin%20android%2015%20means%26nbsp%3Bgives%20me%20the%20correct_portrait_view%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22correct_portrait_view.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22correct_portrait_view.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F353878i4F3E7E66291FFB36%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22correct_portrait_view.jpg%22%20alt%3D%22correct_portrait_view.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EHowever%2C%20this%20command%20does%20not%20work%20on%20Android%2011.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3EI%20will%20attach%20an%20image%20showing%20the%20orientation%20I%20am%20expecting%20in%20Android%2010%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22correct_portrait_view.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22correct_portrait_view.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F353879i4AC6F309AD105594%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22correct_portrait_view.jpg%22%20alt%3D%22correct_portrait_view.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22georgia%2Cpalatino%22%20color%3D%22%23000000%22%3E%3CBR%20%2F%3EThanks%20%26amp%3BRegards%3CBR%20%2F%3ESubash.P%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2157311%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAndroid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGraphics%20%26amp%3B%20Display%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2158287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20change%20the%20display%20Orientation%20in%20Android%2010%20hdmi%20port%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2158287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151788%22%20target%3D%22_blank%22%3E%40Zhiming_Liu%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EAfter%20applying%20your%20patch%2C%20I%20can%20see%20some%20changes%20on%20my%20screen%2C%20but%20the%20resolution%20is%20not%20good.%20Also%2C%20when%20I%20connect%20a%20mouse%2C%20it%20works%20in%20the%20way%20of%20landscape%20navigation%2C%20not%20in%20portrait%20navigation.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAnd%20also%2C%20the%20navigation%20bar%20is%20not%20visible.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22a6a427ba-b133-4e1c-9cc8-b7fe694ef852.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22a6a427ba-b133-4e1c-9cc8-b7fe694ef852.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F354107i3DEC5D2F7B48A60F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22a6a427ba-b133-4e1c-9cc8-b7fe694ef852.jpg%22%20alt%3D%22a6a427ba-b133-4e1c-9cc8-b7fe694ef852.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ESubash%20P.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2157866%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20change%20the%20display%20Orientation%20in%20Android%2010%20hdmi%20port%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2157866%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Esurfaceflinger%20rotation%20information%20will%20not%20pass%20to%20HWC%20in%20Android10%2C%20please%20try%20the%20attachment%20in%20HAL%20and%20use%20'settings%20put%20system%20accelerometer_rotation%200%2F1'%20for%20test.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ediff%20--git%20a%2Fdisplay%2Fdisplay%2FComposer.cpp%20b%2Fdisplay%2Fdisplay%2FComposer.cpp%0Aold%20mode%20100644%0Anew%20mode%20100755%0Aindex%208dba110..282c4f8%0A---%20a%2Fdisplay%2Fdisplay%2FComposer.cpp%0A%2B%2B%2B%20b%2Fdisplay%2Fdisplay%2FComposer.cpp%0A%40%40%20-350%2C11%20%2B350%2C40%20%40%40%20int%20Composer%3A%3AclearWormHole(LayerVector%26amp%3B%20layers)%0A%20%0A%20int%20Composer%3A%3AcomposeLayer(Layer*%20layer%2C%20bool%20bypass)%0A%20%7B%0A%2B%09int%20transform%3B%0A%20%20%20%20%20if%20(layer%20%3D%3D%20NULL%20%7C%7C%20mTarget%20%3D%3D%20NULL)%20%7B%0A%20%20%20%20%20%20%20%20%20ALOGE(%22composeLayer%3A%20invalid%20layer%20or%20target%22)%3B%0A%20%20%20%20%20%20%20%20%20return%20-EINVAL%3B%0A%20%20%20%20%20%7D%0A%20%0A%2B%0A%2B%09%2F*%0A%2B%09%090%20%3D%26gt%3B%20%20%20%20%204%0A%2B%09%20%20%204%20%20%3D%26gt%3B%20%20%203%0A%2B%09%20%20%203%20%20%3D%26gt%3B%20%20%207%0A%2B%09%20%20%207%20%20%3D%26gt%3B%20%20%200%0A%2B%09*%2F%0A%2B%09ALOGI(%22liutest1%20composeLayer%20transform%3A0x%25x%5Cn%22%2Clayer-%26gt%3Btransform)%3B%0A%2B%0A%2B%09switch%20(layer-%26gt%3Btransform)%0A%2B%09%7B%0A%2B%09case%200%3A%0A%2B%09%09transform%20%3D%204%3B%0A%2B%09%09break%3B%0A%2B%09case%204%3A%0A%2B%09%09transform%20%3D%203%3B%0A%2B%09%09break%3B%0A%2B%09case%203%3A%0A%2B%09%09transform%20%3D%207%3B%0A%2B%09%09break%3B%0A%2B%09case%207%3A%0A%2B%09%09transform%20%3D%200%3B%0A%2B%09%09break%3B%0A%2B%0A%2B%09default%3A%0A%2B%09%09ALOGI(%22liutest1%20invalid%20transform%3A0x%25x%5Cn%22%2Clayer-%26gt%3Btransform)%3B%0A%2B%09%7D%0A%2B%0A%20%20%20%20%20if%20(bypass%20%26amp%3B%26amp%3B%20layer-%26gt%3BisSolidColor())%20%7B%0A%20%20%20%20%20%20%20%20%20ALOGV(%22composeLayer%20dim%20layer%20bypassed%22)%3B%0A%20%20%20%20%20%20%20%20%20return%200%3B%0A%40%40%20-392%2C7%20%2B421%2C7%20%40%40%20int%20Composer%3A%3AcomposeLayer(Layer*%20layer%2C%20bool%20bypass)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%0A-%20%20%20%20%20%20%20%20setClipping(srect%2C%20drect%2C%20clip%2C%20layer-%26gt%3Btransform)%3B%0A%2B%20%20%20%20%20%20%20%20setClipping(srect%2C%20drect%2C%20clip%2C%20%2F*layer-%26gt%3Btransform*%2Ftransform)%3B%0A%20%20%20%20%20%20%20%20%20ALOGV(%22index%3A%25d%2C%20i%3A%25d%20sourceCrop(l%3A%25d%2Ct%3A%25d%2Cr%3A%25d%2Cb%3A%25d)%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22visible(l%3A%25d%2Ct%3A%25d%2Cr%3A%25d%2Cb%3A%25d)%2C%20%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22display(l%3A%25d%2Ct%3A%25d%2Cr%3A%25d%2Cb%3A%25d)%22%2C%20layer-%26gt%3Bindex%2C%20(int)i%2C%0A%40%40%20-403%2C8%20%2B432%2C9%20%40%40%20int%20Composer%3A%3AcomposeLayer(Layer*%20layer%2C%20bool%20bypass)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20ALOGV(%22zorder%3A0x%25x%2C%20layer%20phys%3A0x%25%22%20PRIx64%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20layer-%26gt%3Bzorder%2C%20layer-%26gt%3Bhandle-%26gt%3Bphys)%3B%0A%20%20%20%20%20%20%20%20%20%7D%0A-%20%20%20%20%20%20%20%20ALOGV(%22transform%3A0x%25x%2C%20blend%3A0x%25x%2C%20alpha%3A0x%25x%22%2C%0A-%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20layer-%26gt%3Btransform%2C%20layer-%26gt%3BblendMode%2C%20layer-%26gt%3BplaneAlpha)%3B%0A%2B%20%20%20%20%20%20%20%20%2F*ALOGV*%2FALOGI(%22liutest1%20transform%3A0x%25x%3A0x%25x%2C%20blend%3A0x%25x%2C%20alpha%3A0x%25x%22%2C%0A%2B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20layer-%26gt%3Btransform%2Ctransform%2C%20layer-%26gt%3BblendMode%2C%20layer-%26gt%3BplaneAlpha)%3B%0A%2B%0A%20%0A%20%20%20%20%20%20%20%20%20setG2dSurface(dSurfaceX%2C%20mTarget%2C%20drect)%3B%0A%20%0A%40%40%20-422%2C7%20%2B452%2C7%20%40%40%20int%20Composer%3A%3AcomposeLayer(Layer*%20layer%2C%20bool%20bypass)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20return%20-EINVAL%3B%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%0A-%20%20%20%20%20%20%20%20convertRotation(layer-%26gt%3Btransform%2C%20sSurface%2C%20dSurface)%3B%0A%2B%20%20%20%20%20%20%20%20convertRotation(%2F*layer-%26gt%3Btransform*%2Ftransform%2C%20sSurface%2C%20dSurface)%3B%0A%20%20%20%20%20%20%20%20%20if%20(!bypass)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20convertBlending(layer-%26gt%3BblendMode%2C%20sSurface%2C%20dSurface)%3B%0A%20%20%20%20%20%20%20%20%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E