!3742 RSSurfaceRenderNodeTest add ut

Merge pull request !3742 from shiguoquan/master
This commit is contained in:
openharmony_ci 2023-02-24 09:11:27 +00:00 committed by Gitee
commit 6bd45ef66d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -148,12 +148,12 @@ HWTEST_F(RSSurfaceRenderNodeTest, SetGlobalDirtyRegion, TestSize.Level1)
}
/**
* @tc.name: ResetSurfaceOpaqueRegion
* @tc.name: ResetSurfaceOpaqueRegion01
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I68IPR
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion, TestSize.Level1)
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion01, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
@ -162,5 +162,115 @@ HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion, TestSize.Level1)
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, containerWindowConfigType, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, containerWindowConfigType, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion02
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion02, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(0);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion03
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion03, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(255);
surfaceRenderNode.SetGlobalAlpha(1.0f);
surfaceRenderNode.SetSurfaceNodeType(RSSurfaceNodeType::APP_WINDOW_NODE);
surfaceRenderNode.SetContainerWindow(true, 1.0f);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion04
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion04, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(255);
surfaceRenderNode.SetGlobalAlpha(1.0f);
surfaceRenderNode.GetMutableRenderProperties().SetCornerRadius(Vector4f(15.0f));
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_0, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion05
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion05, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(255);
surfaceRenderNode.SetGlobalAlpha(1.0f);
surfaceRenderNode.SetSurfaceNodeType(RSSurfaceNodeType::APP_WINDOW_NODE);
surfaceRenderNode.SetContainerWindow(true, 1.0f);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_90, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_90, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion06
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion06, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(255);
surfaceRenderNode.SetGlobalAlpha(1.0f);
surfaceRenderNode.SetSurfaceNodeType(RSSurfaceNodeType::APP_WINDOW_NODE);
surfaceRenderNode.SetContainerWindow(true, 1.0f);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_180, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_180, true);
}
/**
* @tc.name: ResetSurfaceOpaqueRegion07
* @tc.desc: function test
* @tc.type:FUNC
* @tc.require: I6HF6Y
*/
HWTEST_F(RSSurfaceRenderNodeTest, ResetSurfaceOpaqueRegion07, TestSize.Level1)
{
RSSurfaceRenderNode surfaceRenderNode(id, context);
RectI screenRect {0, 0, 2560, 1600};
RectI absRect {0, 100, 400, 500};
surfaceRenderNode.SetAbilityBGAlpha(255);
surfaceRenderNode.SetGlobalAlpha(1.0f);
surfaceRenderNode.SetSurfaceNodeType(RSSurfaceNodeType::APP_WINDOW_NODE);
surfaceRenderNode.SetContainerWindow(true, 1.0f);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_270, false);
surfaceRenderNode.ResetSurfaceOpaqueRegion(screenRect, absRect, ScreenRotation::ROTATION_270, true);
}
} // namespace Rosen
} // namespace OHOS