Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaylist ColorFilter objects #31491

Merged
merged 8 commits into from
Feb 17, 2022
Prev Previous commit
Next Next commit
add test to be clear that objects from shared() are copies
  • Loading branch information
flar committed Feb 17, 2022
commit 2a01090b9dba3bea98f5da40c8c39d69c9f7444a
5 changes: 5 additions & 0 deletions display_list/display_list_color_filter_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ TEST(DisplayListColorFilter, BlendConstructor) {

TEST(DisplayListColorFilter, BlendShared) {
DlBlendColorFilter filter(SK_ColorRED, SkBlendMode::kDstATop);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}

Expand Down Expand Up @@ -128,6 +129,7 @@ TEST(DisplayListColorFilter, MatrixConstructor) {

TEST(DisplayListColorFilter, MatrixShared) {
DlMatrixColorFilter filter(matrix);
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}

Expand Down Expand Up @@ -181,6 +183,7 @@ TEST(DisplayListColorFilter, SrgbToLinearConstructor) {

TEST(DisplayListColorFilter, SrgbToLinearShared) {
DlSrgbToLinearGammaColorFilter filter;
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}

Expand All @@ -201,6 +204,7 @@ TEST(DisplayListColorFilter, LinearToSrgbConstructor) {

TEST(DisplayListColorFilter, LinearToSrgbShared) {
DlLinearToSrgbGammaColorFilter filter;
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}

Expand All @@ -221,6 +225,7 @@ TEST(DisplayListColorFilter, UnknownConstructor) {

TEST(DisplayListColorFilter, UnknownShared) {
DlUnknownColorFilter filter(SkColorFilters::LinearToSRGBGamma());
ASSERT_NE(filter.shared().get(), &filter);
ASSERT_EQ(*filter.shared(), filter);
}

Expand Down