@@ -791,6 +791,37 @@ TEST_P(AiksTest, CanRenderConicalGradient) {
791791 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
792792}
793793
794+ TEST_P (AiksTest, CanRenderGradientDecalWithBackground) {
795+ std::vector<Color> colors = {Color::MakeRGBA8 (0xF4 , 0x43 , 0x36 , 0xFF ),
796+ Color::MakeRGBA8 (0xFF , 0xEB , 0x3B , 0xFF ),
797+ Color::MakeRGBA8 (0x4c , 0xAF , 0x50 , 0xFF ),
798+ Color::MakeRGBA8 (0x21 , 0x96 , 0xF3 , 0xFF )};
799+ std::vector<Scalar> stops = {0.0 , 1 .f / 3 .f , 2 .f / 3 .f , 1.0 };
800+
801+ std::array<ColorSource, 3 > color_sources = {
802+ ColorSource::MakeLinearGradient ({0 , 0 }, {100 , 100 }, colors, stops,
803+ Entity::TileMode::kDecal , {}),
804+ ColorSource::MakeRadialGradient ({100 , 100 }, 100 , colors, stops,
805+ Entity::TileMode::kDecal , {}),
806+ ColorSource::MakeSweepGradient ({100 , 100 }, Degrees (45 ), Degrees (135 ),
807+ colors, stops, Entity::TileMode::kDecal ,
808+ {}),
809+ };
810+
811+ Canvas canvas;
812+ Paint paint;
813+ paint.color = Color::White ();
814+ canvas.DrawRect (Rect::MakeLTRB (0 , 0 , 605 , 205 ), paint);
815+ for (int i = 0 ; i < 3 ; i++) {
816+ canvas.Save ();
817+ canvas.Translate ({i * 200 .0f , 0 , 0 });
818+ paint.color_source = color_sources[i];
819+ canvas.DrawRect (Rect::MakeLTRB (0 , 0 , 200 , 200 ), paint);
820+ canvas.Restore ();
821+ }
822+ ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
823+ }
824+
794825TEST_P (AiksTest, CanRenderDifferentShapesWithSameColorSource) {
795826 Canvas canvas;
796827 Paint paint;
0 commit comments