native test case update

Signed-off-by: HaoXinyu <haoxinyu1@huawei.com>
This commit is contained in:
HaoXinyu 2024-11-19 15:10:23 +08:00
parent 602468aea6
commit 1df8498cf3
37 changed files with 184 additions and 153 deletions

View File

@ -25,8 +25,8 @@ namespace OHOS::Rosen {
class ContentEffectNodeTest : public RSGraphicTest { class ContentEffectNodeTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class AppearanceTest01 : public RSGraphicTest { class AppearanceTest01 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -58,9 +58,9 @@ GRAPHIC_TEST(AppearanceTest01, CONTENT_DISPLAY_TEST, Appearance_Border_Radius_Co
const int nodeCount = 4; const int nodeCount = 4;
const int columnCount = 2; const int columnCount = 2;
const int nodeSize = 500; const int nodeSize = 400;
const int nodeHalfSize = 250; const int nodeHalfSize = 200;
const int nodePos = 520; const int nodePos = 420;
for (int i = 0; i < nodeCount; i++) { for (int i = 0; i < nodeCount; i++) {
int x = (i % columnCount) * nodePos; int x = (i % columnCount) * nodePos;

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class AppearanceTest02 : public RSGraphicTest { class AppearanceTest02 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -56,9 +56,9 @@ GRAPHIC_TEST(AppearanceTest02, CONTENT_DISPLAY_TEST, Appearance_Border_Color_Tes
const int nodeCount = 4; const int nodeCount = 4;
const int columnCount = 2; const int columnCount = 2;
const int nodeSize = 500; const int nodeSize = 400;
const int nodeHalfSize = 250; const int nodeHalfSize = 200;
const int nodePos = 520; const int nodePos = 420;
const int testPos = 50; const int testPos = 50;
for (int i = 0; i < nodeCount; i++) { for (int i = 0; i < nodeCount; i++) {

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class AppearanceTest03 : public RSGraphicTest { class AppearanceTest03 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -56,9 +56,9 @@ GRAPHIC_TEST(AppearanceTest03, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Ra
const int nodeCount = 4; const int nodeCount = 4;
const int columnCount = 2; const int columnCount = 2;
const int nodeSize = 500; const int nodeSize = 400;
const int nodeHalfSize = 250; const int nodeHalfSize = 200;
const int nodePos = 520; const int nodePos = 420;
for (int i = 0; i < nodeCount; i++) { for (int i = 0; i < nodeCount; i++) {
int x = (i % columnCount) * nodePos; int x = (i % columnCount) * nodePos;
@ -107,11 +107,11 @@ GRAPHIC_TEST(AppearanceTest03, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Ra
const int nodeCount = 3; const int nodeCount = 3;
const int columnCount = 2; const int columnCount = 2;
const int nodeSize = 500; const int nodeSize = 400;
const int nodePos = 520; const int nodePos = 420;
const float radiusVal = 50.0f; const float radiusVal = 50.0f;
const int offsetVal = 20; const int offsetVal = 20;
const int offsetVal2 = 600; const int offsetVal2 = 400;
for (int i = 0; i < nodeCount; i++) { for (int i = 0; i < nodeCount; i++) {
int x = (i % columnCount) * nodePos; int x = (i % columnCount) * nodePos;

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class AppearanceTest04 : public RSGraphicTest { class AppearanceTest04 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -53,10 +53,10 @@ GRAPHIC_TEST(AppearanceTest04, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Co
Color colorList[] = { Color(0, 0, 0), Color(255, 0, 0), Color(0, 255, 0), Color(0, 0, 255) }; Color colorList[] = { Color(0, 0, 0), Color(255, 0, 0), Color(0, 255, 0), Color(0, 0, 255) };
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * FIVE_HUNDRED_TWENTY_; int x = (i % TWO_) * FOUR_HUNDRED_TWENTY_;
int y = (i / TWO_) * FIVE_HUNDRED_TWENTY_; int y = (i / TWO_) * FOUR_HUNDRED_TWENTY_;
auto testNodeColor = RSCanvasNode::Create(); auto testNodeColor = RSCanvasNode::Create();
setNode(testNodeColor, { x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }, Vector4<Color>(colorList[i])); setNode(testNodeColor, { x, y, FOUR_HUNDRED_, FOUR_HUNDRED_ }, Vector4<Color>(colorList[i]));
GetRootNode()->AddChild(testNodeColor); GetRootNode()->AddChild(testNodeColor);
RegisterNode(testNodeColor); RegisterNode(testNodeColor);
} }
@ -64,28 +64,27 @@ GRAPHIC_TEST(AppearanceTest04, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Co
// parent black, child red color, white border // parent black, child red color, white border
auto testNodeParent = RSCanvasNode::Create(); auto testNodeParent = RSCanvasNode::Create();
setNode( setNode(
testNodeParent, { 0, FIVE_HUNDRED_TWENTY_ * 2, FIVE_HUNDRED_, FIVE_HUNDRED_ }, Vector4<Color>(colorList[0])); testNodeParent, { 0, FOUR_HUNDRED_TWENTY_ * 2, FOUR_HUNDRED_, FOUR_HUNDRED_ }, Vector4<Color>(colorList[0]));
testNodeParent->SetBackgroundColor(0xff000000); testNodeParent->SetBackgroundColor(0xff000000);
GetRootNode()->AddChild(testNodeParent); GetRootNode()->AddChild(testNodeParent);
RegisterNode(testNodeParent); RegisterNode(testNodeParent);
auto testNodeChild = RSCanvasNode::Create(); auto testNodeChild = RSCanvasNode::Create();
setNode( setNode(testNodeChild, { FIFTY_, FIFTY_, TWO_HUNDRED_, TWO_HUNDRED_ }, Vector4<Color>(Color(0xffffffff)));
testNodeChild, { FIFTY_, FIFTY_, TWO_HUNDRED_FIFTY_, TWO_HUNDRED_FIFTY_ }, Vector4<Color>(Color(0xffffffff)));
testNodeChild->SetForegroundColor(0xffff0000); testNodeChild->SetForegroundColor(0xffff0000);
testNodeParent->AddChild(testNodeChild); testNodeParent->AddChild(testNodeChild);
RegisterNode(testNodeChild); RegisterNode(testNodeChild);
// alpha border // alpha border
auto testNodeAlphaColor = RSCanvasNode::Create(); auto testNodeAlphaColor = RSCanvasNode::Create();
setNode(testNodeAlphaColor, { FIVE_HUNDRED_TWENTY_, FIVE_HUNDRED_TWENTY_ * 2, FIVE_HUNDRED_, FIVE_HUNDRED_ }, setNode(testNodeAlphaColor, { FOUR_HUNDRED_TWENTY_, FOUR_HUNDRED_TWENTY_ * 2, FOUR_HUNDRED_, FOUR_HUNDRED_ },
Vector4<Color>(Color(0x7dffffff))); Vector4<Color>(Color(0x7dffffff)));
GetRootNode()->AddChild(testNodeAlphaColor); GetRootNode()->AddChild(testNodeAlphaColor);
RegisterNode(testNodeAlphaColor); RegisterNode(testNodeAlphaColor);
// four different color // four different color
auto testNodeFourColor = RSCanvasNode::Create(); auto testNodeFourColor = RSCanvasNode::Create();
setNode(testNodeFourColor, { 0, FIVE_HUNDRED_TWENTY_ * 3, FIVE_HUNDRED_, FIVE_HUNDRED_ }, setNode(testNodeFourColor, { 0, FOUR_HUNDRED_TWENTY_ * 3, FOUR_HUNDRED_, FOUR_HUNDRED_ },
Vector4<Color>(colorList[0], colorList[1], colorList[2], colorList[3])); Vector4<Color>(colorList[0], colorList[1], colorList[2], colorList[3]));
GetRootNode()->AddChild(testNodeFourColor); GetRootNode()->AddChild(testNodeFourColor);
RegisterNode(testNodeFourColor); RegisterNode(testNodeFourColor);
@ -100,10 +99,10 @@ GRAPHIC_TEST(AppearanceTest04, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Wi
Vector4<Color> outLineColor = { color, color, color, color }; Vector4<Color> outLineColor = { color, color, color, color };
for (int i = 0; i < THREE_; i++) { for (int i = 0; i < THREE_; i++) {
int x = (i % TWO_) * FIVE_HUNDRED_TWENTY_; int x = (i % TWO_) * FOUR_HUNDRED_TWENTY_;
int y = (i / TWO_) * FIVE_HUNDRED_TWENTY_; int y = (i / TWO_) * FOUR_HUNDRED_TWENTY_;
auto testNodeWidth = RSCanvasNode::Create(); auto testNodeWidth = RSCanvasNode::Create();
testNodeWidth->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeWidth->SetBounds({ x, y, FOUR_HUNDRED_, FOUR_HUNDRED_ });
testNodeWidth->SetTranslate(widthList[i] + TWENTY_, widthList[i] + FIFTY_, 0); testNodeWidth->SetTranslate(widthList[i] + TWENTY_, widthList[i] + FIFTY_, 0);
testNodeWidth->SetOutlineStyle(style); testNodeWidth->SetOutlineStyle(style);
testNodeWidth->SetOutlineWidth({ widthList[i], widthList[i], widthList[i], widthList[i] }); testNodeWidth->SetOutlineWidth({ widthList[i], widthList[i], widthList[i], widthList[i] });
@ -114,8 +113,8 @@ GRAPHIC_TEST(AppearanceTest04, CONTENT_DISPLAY_TEST, Appearance_OutlineBorder_Wi
// four different width // four different width
auto testNodeFourWidth = RSCanvasNode::Create(); auto testNodeFourWidth = RSCanvasNode::Create();
testNodeFourWidth->SetBounds({ 0, FIVE_HUNDRED_TWENTY_ * 2, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeFourWidth->SetBounds({ 0, FOUR_HUNDRED_TWENTY_ * 2, FOUR_HUNDRED_, FOUR_HUNDRED_ });
testNodeFourWidth->SetTranslate(TWENTY_, SIX_HUNDRED_, 0); testNodeFourWidth->SetTranslate(TWENTY_, FOUR_HUNDRED_, 0);
testNodeFourWidth->SetOutlineStyle(style); testNodeFourWidth->SetOutlineStyle(style);
testNodeFourWidth->SetOutlineWidth({ widthList[1] * 0, widthList[1] * 2, widthList[1] * 4, widthList[1] * 8 }); testNodeFourWidth->SetOutlineWidth({ widthList[1] * 0, widthList[1] * 2, widthList[1] * 4, widthList[1] * 8 });
testNodeFourWidth->SetOutlineColor(outLineColor); testNodeFourWidth->SetOutlineColor(outLineColor);

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -40,12 +40,16 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Color_Test_
{ {
uint32_t colorList[] = { 0xff000000, 0xffff0000, 0xff00ff00, 0xff0000ff }; uint32_t colorList[] = { 0xff000000, 0xffff0000, 0xff00ff00, 0xff0000ff };
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeColor = RSCanvasNode::Create(); auto testNodeColor = RSCanvasNode::Create();
testNodeColor->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeColor->SetBounds({ x, y, nodeSize, nodeSize });
testNodeColor->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeColor->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeColor->SetShadowColor(colorList[i]); testNodeColor->SetShadowColor(colorList[i]);
testNodeColor->SetShadowRadius(FIFTY_); testNodeColor->SetShadowRadius(FIFTY_);
GetRootNode()->AddChild(testNodeColor); GetRootNode()->AddChild(testNodeColor);
@ -56,12 +60,16 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Color_Test_
// shadow offset // shadow offset
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test_1)
{ {
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeOffset = RSCanvasNode::Create(); auto testNodeOffset = RSCanvasNode::Create();
testNodeOffset->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeOffset->SetBounds({ x, y, nodeSize, nodeSize });
testNodeOffset->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeOffset->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeOffset->SetShadowColor(0xff000000); testNodeOffset->SetShadowColor(0xff000000);
switch (i) { switch (i) {
case 0: { case 0: {
@ -91,12 +99,16 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test_2) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test_2)
{ {
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
for (int i = 0; i < FIVE_; i++) { for (int i = 0; i < FIVE_; i++) {
int x = (i % TWO_) * FIVE_HUNDRED_TEN_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeOffset = RSCanvasNode::Create(); auto testNodeOffset = RSCanvasNode::Create();
testNodeOffset->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeOffset->SetBounds({ x, y, nodeSize, nodeSize });
testNodeOffset->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeOffset->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeOffset->SetBackgroundColor(0xffc0c0c0); testNodeOffset->SetBackgroundColor(0xffc0c0c0);
testNodeOffset->SetShadowColor(0xff000000); testNodeOffset->SetShadowColor(0xff000000);
testNodeOffset->SetShadowRadius(50); testNodeOffset->SetShadowRadius(50);
@ -119,8 +131,8 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test
break; break;
} }
case 4: { case 4: {
testNodeOffset->SetTranslate(0, TWO_HUNDRED_, 0); testNodeOffset->SetTranslate(0, nodeOffset, 0);
testNodeOffset->SetShadowOffset(FIVE_HUNDRED_, FIVE_HUNDRED_); testNodeOffset->SetShadowOffset(nodeSize, nodeSize);
break; break;
} }
default: default:
@ -134,14 +146,18 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Offset_Test
// shadow alpha // shadow alpha
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Alpha_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Alpha_Test_1)
{ {
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
float alphaList[] = { 0, 0.2, 0.8, 1 }; float alphaList[] = { 0, 0.2, 0.8, 1 };
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeAlpha = RSCanvasNode::Create(); auto testNodeAlpha = RSCanvasNode::Create();
testNodeAlpha->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeAlpha->SetBounds({ x, y, nodeSize, nodeSize });
testNodeAlpha->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeAlpha->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeAlpha->SetBackgroundColor(0xffc0c0c0); testNodeAlpha->SetBackgroundColor(0xffc0c0c0);
testNodeAlpha->SetShadowColor(0xff000000); testNodeAlpha->SetShadowColor(0xff000000);
testNodeAlpha->SetShadowAlpha(alphaList[i]); testNodeAlpha->SetShadowAlpha(alphaList[i]);
@ -154,14 +170,18 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Alpha_Test_
// shadow radius // shadow radius
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Radius_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Radius_Test_1)
{ {
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
float radiusList[] = { 0, 50, 250 }; float radiusList[] = { 0, 50, 250 };
for (int i = 0; i < THREE_; i++) { for (int i = 0; i < THREE_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeRadius = RSCanvasNode::Create(); auto testNodeRadius = RSCanvasNode::Create();
testNodeRadius->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeRadius->SetBounds({ x, y, nodeSize, nodeSize });
testNodeRadius->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeRadius->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeRadius->SetBackgroundColor(0xffc0c0c0); testNodeRadius->SetBackgroundColor(0xffc0c0c0);
testNodeRadius->SetShadowColor(0xff000000); testNodeRadius->SetShadowColor(0xff000000);
testNodeRadius->SetShadowRadius(radiusList[i]); testNodeRadius->SetShadowRadius(radiusList[i]);
@ -173,15 +193,15 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Radius_Test
const int yPos = 1250; const int yPos = 1250;
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
auto testNodeParent = RSCanvasNode::Create(); auto testNodeParent = RSCanvasNode::Create();
testNodeParent->SetBounds({ i * SIX_HUNDRED_, yPos, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeParent->SetBounds({ i * nodePos, yPos, nodeSize, nodeSize });
testNodeParent->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeParent->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeParent->SetClipToBounds(i); testNodeParent->SetClipToBounds(i);
GetRootNode()->AddChild(testNodeParent); GetRootNode()->AddChild(testNodeParent);
RegisterNode(testNodeParent); RegisterNode(testNodeParent);
auto testNodeChild = RSCanvasNode::Create(); auto testNodeChild = RSCanvasNode::Create();
testNodeChild->SetBounds({ 0, 0, FOUR_HUNDRED_, FOUR_HUNDRED_ }); testNodeChild->SetBounds({ 0, 0, nodeSize, nodeSize });
testNodeChild->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeChild->SetTranslate(nodeOffset, nodeOffset, 0);
testNodeChild->SetBackgroundColor(0xffc0c0c0); testNodeChild->SetBackgroundColor(0xffc0c0c0);
testNodeChild->SetShadowColor(0xff000000); testNodeChild->SetShadowColor(0xff000000);
testNodeChild->SetShadowRadius(FIFTY_); testNodeChild->SetShadowRadius(FIFTY_);
@ -237,17 +257,21 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Strategy_Te
// shadow filled // shadow filled
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Filled_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Filled_Test_1)
{ {
int nodePos = 500;
int nodeOffset = 100;
int nodeSize = 400;
float alphaList[] = { 1, 0.5 }; float alphaList[] = { 1, 0.5 };
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeFilled = RSCanvasNode::Create(); auto testNodeFilled = RSCanvasNode::Create();
testNodeFilled->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeFilled->SetBounds({ x, y, nodeSize, nodeSize });
testNodeFilled->SetTranslate(ONE_HUNDRED_, ONE_HUNDRED_, 0); testNodeFilled->SetTranslate(nodeOffset, nodeOffset, 0);
auto imageModifier = std::make_shared<ImageCustomModifier>(); auto imageModifier = std::make_shared<ImageCustomModifier>();
imageModifier->SetWidth(FIVE_HUNDRED_); imageModifier->SetWidth(nodeSize);
imageModifier->SetHeight(FIVE_HUNDRED_); imageModifier->SetHeight(nodeSize);
imageModifier->SetPixelMapPath("/data/local/tmp/appearance_test.jpg"); imageModifier->SetPixelMapPath("/data/local/tmp/appearance_test.jpg");
testNodeFilled->AddModifier(imageModifier); testNodeFilled->AddModifier(imageModifier);
testNodeFilled->SetAlpha(0.5); testNodeFilled->SetAlpha(0.5);
@ -264,14 +288,17 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Filled_Test
// shadow mask // shadow mask
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_mask_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_mask_Test_1)
{ {
int nodePos = 500;
int nodeSize = 400;
for (int i = 0; i < TWO_; i++) { for (int i = 0; i < TWO_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeMask = RSCanvasNode::Create(); auto testNodeMask = RSCanvasNode::Create();
testNodeMask->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeMask->SetBounds({ x, y, nodeSize, nodeSize });
auto imageModifier = std::make_shared<ImageCustomModifier>(); auto imageModifier = std::make_shared<ImageCustomModifier>();
imageModifier->SetWidth(FIVE_HUNDRED_); imageModifier->SetWidth(nodeSize);
imageModifier->SetHeight(FIVE_HUNDRED_); imageModifier->SetHeight(nodeSize);
imageModifier->SetPixelMapPath("/data/local/tmp/appearance_test.jpg"); imageModifier->SetPixelMapPath("/data/local/tmp/appearance_test.jpg");
testNodeMask->AddModifier(imageModifier); testNodeMask->AddModifier(imageModifier);
testNodeMask->SetShadowMask(i); testNodeMask->SetShadowMask(i);
@ -285,14 +312,17 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_mask_Test_1
// shadow touch // shadow touch
GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Touch_Test_1) GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, Appearance_Shadow_Touch_Test_1)
{ {
int nodePos = 500;
int nodeSize = 400;
float alphaList[] = { 1, 0.5 }; float alphaList[] = { 1, 0.5 };
uint32_t colorList[] = { 0xff000000, 0xffff0000 }; uint32_t colorList[] = { 0xff000000, 0xffff0000 };
for (int i = 0; i < FOUR_; i++) { for (int i = 0; i < FOUR_; i++) {
int x = (i % TWO_) * SIX_HUNDRED_; int x = (i % TWO_) * nodePos;
int y = (i / TWO_) * SIX_HUNDRED_; int y = (i / TWO_) * nodePos;
auto testNodeTouch = RSCanvasNode::Create(); auto testNodeTouch = RSCanvasNode::Create();
testNodeTouch->SetBounds({ x, y, FIVE_HUNDRED_, FIVE_HUNDRED_ }); testNodeTouch->SetBounds({ x, y, nodeSize, nodeSize });
testNodeTouch->SetShadowColor(colorList[i]); testNodeTouch->SetShadowColor(colorList[i]);
testNodeTouch->SetShadowRadius(ONE_HUNDRED_); testNodeTouch->SetShadowRadius(ONE_HUNDRED_);
testNodeTouch->SetShadowAlpha(alphaList[i / TWO_]); testNodeTouch->SetShadowAlpha(alphaList[i / TWO_]);

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -27,8 +27,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -26,8 +26,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class ForegroundTest01 : public RSGraphicTest { class ForegroundTest01 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class ForegroundTest02 : public RSGraphicTest { class ForegroundTest02 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -27,8 +27,8 @@ namespace OHOS::Rosen {
class ForegroundTest : public RSGraphicTest { class ForegroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -37,7 +37,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, CameraDistance_Test_1)
{ {
float zList[] = { 0.0, 0.5, 1, 100.0 }; float zList[] = { 0.0, 0.5, 1, 100.0 };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 480 + 40, 600, 600 });
testNode->SetPivot(Vector2f(0.5, 0.5)); testNode->SetPivot(Vector2f(0.5, 0.5));
testNode->SetRotation(45.0, 0, 45.0); testNode->SetRotation(45.0, 0, 45.0);
testNode->SetCameraDistance(zList[i]); testNode->SetCameraDistance(zList[i]);

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -24,8 +24,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -42,7 +42,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_0_Rotation_float_Test_1)
{ 45, 45, 45 }, { 45, 45, 45 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(0, 0)); testNode->SetPivot(Vector2f(0, 0));
testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]); testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -59,7 +59,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_05_Rotation_float_Test_1)
{ 45, 45, 45 }, { 45, 45, 45 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(0.5, 0.5)); testNode->SetPivot(Vector2f(0.5, 0.5));
testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]); testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -76,7 +76,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_1_Rotation_float_Test_1)
{ 45, 45, 45 }, { 45, 45, 45 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(1, 1)); testNode->SetPivot(Vector2f(1, 1));
testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]); testNode->SetRotation(degreeList[i][0], degreeList[i][1], degreeList[i][2]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -93,7 +93,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_0_Rotation_quaternion_Tes
{ 0.462, 0.191, 0.462, 0.733 }, { 0.462, 0.191, 0.462, 0.733 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(0, 0)); testNode->SetPivot(Vector2f(0, 0));
testNode->SetRotation(degreeList[i]); testNode->SetRotation(degreeList[i]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -110,7 +110,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_05_Rotation_quaternion_Te
{ 0.462, 0.191, 0.462, 0.733 }, { 0.462, 0.191, 0.462, 0.733 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(0.5, 0.5)); testNode->SetPivot(Vector2f(0.5, 0.5));
testNode->SetRotation(degreeList[i]); testNode->SetRotation(degreeList[i]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -127,7 +127,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Pivot_1_Rotation_quaternion_Tes
{ 0.462, 0.191, 0.462, 0.733 }, { 0.462, 0.191, 0.462, 0.733 },
}; };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(1, 1)); testNode->SetPivot(Vector2f(1, 1));
testNode->SetRotation(degreeList[i]); testNode->SetRotation(degreeList[i]);
GetRootNode()->AddChild(testNode); GetRootNode()->AddChild(testNode);
@ -139,7 +139,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, PivotZ_Rotation_Test_1)
{ {
float zList[] = { 0.0, 0.5, 1.0, 100.0 }; float zList[] = { 0.0, 0.5, 1.0, 100.0 };
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 380, i * 680 + 40, 600, 600 }); auto testNode = SetUpNodeBgImage("/data/local/tmp/geom_test.jpg", { 280, i * 480 + 40, 400, 400 });
testNode->SetPivot(Vector2f(0.5, 0.5)); testNode->SetPivot(Vector2f(0.5, 0.5));
testNode->SetPivotZ(zList[i]); testNode->SetPivotZ(zList[i]);
testNode->SetRotation(0, 45.0, 0); testNode->SetRotation(0, 45.0, 0);

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -22,8 +22,8 @@ namespace OHOS::Rosen {
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -42,6 +42,8 @@
#define THREE_HUNDRED_ 300 #define THREE_HUNDRED_ 300
#define THREE_HUNDRED_TEN_ 310 #define THREE_HUNDRED_TEN_ 310
#define FOUR_HUNDRED_ 400 #define FOUR_HUNDRED_ 400
#define FOUR_HUNDRED_TEN_ 410
#define FOUR_HUNDRED_TWENTY_ 420
#define FIVE_HUNDRED_ 500 #define FIVE_HUNDRED_ 500
#define FIVE_HUNDRED_TEN_ 510 #define FIVE_HUNDRED_TEN_ 510
#define FIVE_HUNDRED_TWENTY_ 520 #define FIVE_HUNDRED_TWENTY_ 520

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class AppearanceTest : public RSGraphicTest { class AppearanceTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -50,7 +50,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_DrawRoundRect
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = RSCanvasNode::Create(); auto testNodeBackGround = RSCanvasNode::Create();
testNodeBackGround->SetBackgroundColor(0xff0000ff); testNodeBackGround->SetBackgroundColor(0xff0000ff);
testNodeBackGround->SetBounds({ x, y, 500, 300 }); testNodeBackGround->SetBounds({ x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(normalRadius[i]); testNodeBackGround->SetCornerRadius(normalRadius[i]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -63,7 +63,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_DrawRoundRect
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = RSCanvasNode::Create(); auto testNodeBackGround = RSCanvasNode::Create();
testNodeBackGround->SetBackgroundColor(0xff0000ff); testNodeBackGround->SetBackgroundColor(0xff0000ff);
testNodeBackGround->SetBounds({ x, y, 500, 300 }); testNodeBackGround->SetBounds({ x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(asymmetryRadius[j]); testNodeBackGround->SetCornerRadius(asymmetryRadius[j]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -77,7 +77,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_DrawRoundRect
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = RSCanvasNode::Create(); auto testNodeBackGround = RSCanvasNode::Create();
testNodeBackGround->SetBackgroundColor(0xff0000ff); testNodeBackGround->SetBackgroundColor(0xff0000ff);
testNodeBackGround->SetBounds({ x, y, 500, 300 }); testNodeBackGround->SetBounds({ x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(capsuleRadius[j]); testNodeBackGround->SetCornerRadius(capsuleRadius[j]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -99,7 +99,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_ClipRoundRect
for (; i < 2; i++) { for (; i < 2; i++) {
int x = (i % columnCount) * sizeX; int x = (i % columnCount) * sizeX;
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 500, 300 }); auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(normalRadius[i]); testNodeBackGround->SetCornerRadius(normalRadius[i]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -111,7 +111,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_ClipRoundRect
for (; i < 4; i++, j++) { for (; i < 4; i++, j++) {
int x = (i % columnCount) * sizeX; int x = (i % columnCount) * sizeX;
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 500, 300 }); auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(asymmetryRadius[j]); testNodeBackGround->SetCornerRadius(asymmetryRadius[j]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -123,7 +123,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_ClipRoundRect
for (; i < 7; i++, j++) { for (; i < 7; i++, j++) {
int x = (i % columnCount) * sizeX; int x = (i % columnCount) * sizeX;
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 500, 300 }); auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 400, 300 });
testNodeBackGround->SetCornerRadius(capsuleRadius[j]); testNodeBackGround->SetCornerRadius(capsuleRadius[j]);
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);
@ -132,7 +132,7 @@ GRAPHIC_TEST(AppearanceTest, CONTENT_DISPLAY_TEST, G2_CornerRadius_ClipRoundRect
i = 7; i = 7;
int x = (i % columnCount) * sizeX; int x = (i % columnCount) * sizeX;
int y = (i / columnCount) * sizeY; int y = (i / columnCount) * sizeY;
auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 500, 300 }); auto testNodeBackGround = SetUpNodeBgImage("/data/local/tmp/Images/backGroundImage.jpg", { x, y, 400, 300 });
testNodeBackGround->SetCornerRadius({ 160, 180, 200, 220 }); testNodeBackGround->SetCornerRadius({ 160, 180, 200, 220 });
GetRootNode()->AddChild(testNodeBackGround); GetRootNode()->AddChild(testNodeBackGround);
RegisterNode(testNodeBackGround); RegisterNode(testNodeBackGround);

View File

@ -36,8 +36,8 @@ public:
class GeometryTest : public RSGraphicTest { class GeometryTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests
@ -54,7 +54,7 @@ GRAPHIC_TEST(GeometryTest, CONTENT_DISPLAY_TEST, Geometry_Transform_Test)
auto sizeX = screenWidth / columnCount; auto sizeX = screenWidth / columnCount;
auto sizeY = screenHeight / rowCount; auto sizeY = screenHeight / rowCount;
std::vector<Vector2f> transList = { { 1, 5 }, { 5, 2 } }; std::vector<Vector2f> transList = { { 0.1, 0.5 }, { 0.5, 0.2 } };
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
int x = (i % columnCount) * sizeX; int x = (i % columnCount) * sizeX;

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -25,8 +25,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -25,8 +25,8 @@ namespace OHOS::Rosen {
class BackgroundTest01 : public RSGraphicTest { class BackgroundTest01 : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests

View File

@ -23,8 +23,8 @@ namespace OHOS::Rosen {
class BackgroundTest : public RSGraphicTest { class BackgroundTest : public RSGraphicTest {
private: private:
const int screenWidth = 1260; const int screenWidth = 1200;
const int screenHeight = 2720; const int screenHeight = 2000;
public: public:
// called before each tests // called before each tests