OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 const GrAccelData::SaveLayerInfo& info4 = gpuData->saveLayerInfo(5); | 976 const GrAccelData::SaveLayerInfo& info4 = gpuData->saveLayerInfo(5); |
977 const GrAccelData::SaveLayerInfo& info5 = gpuData->saveLayerInfo(4); | 977 const GrAccelData::SaveLayerInfo& info5 = gpuData->saveLayerInfo(4); |
978 | 978 |
979 // The parent/child layers appear in reverse order | 979 // The parent/child layers appear in reverse order |
980 const GrAccelData::SaveLayerInfo& info6 = gpuData->saveLayerInfo(7); | 980 const GrAccelData::SaveLayerInfo& info6 = gpuData->saveLayerInfo(7); |
981 const GrAccelData::SaveLayerInfo& info7 = gpuData->saveLayerInfo(6); | 981 const GrAccelData::SaveLayerInfo& info7 = gpuData->saveLayerInfo(6); |
982 | 982 |
983 REPORTER_ASSERT(reporter, NULL == info0.fPicture); | 983 REPORTER_ASSERT(reporter, NULL == info0.fPicture); |
984 REPORTER_ASSERT(reporter, kWidth == info0.fBounds.width() && | 984 REPORTER_ASSERT(reporter, kWidth == info0.fBounds.width() && |
985 kHeight == info0.fBounds.height()); | 985 kHeight == info0.fBounds.height()); |
986 REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity()); | 986 REPORTER_ASSERT(reporter, info0.fLocalMat.isIdentity()); |
| 987 REPORTER_ASSERT(reporter, info0.fPreMat.isIdentity()); |
987 REPORTER_ASSERT(reporter, 0 == info0.fBounds.fLeft && 0 == info0.fBo
unds.fTop); | 988 REPORTER_ASSERT(reporter, 0 == info0.fBounds.fLeft && 0 == info0.fBo
unds.fTop); |
988 REPORTER_ASSERT(reporter, NULL == info0.fPaint); | 989 REPORTER_ASSERT(reporter, NULL == info0.fPaint); |
989 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer
s); | 990 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer
s); |
990 | 991 |
991 REPORTER_ASSERT(reporter, NULL == info1.fPicture); | 992 REPORTER_ASSERT(reporter, NULL == info1.fPicture); |
992 REPORTER_ASSERT(reporter, kWidth == info1.fBounds.width() && | 993 REPORTER_ASSERT(reporter, kWidth == info1.fBounds.width() && |
993 kHeight == info1.fBounds.height()); | 994 kHeight == info1.fBounds.height()); |
994 REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity()); | 995 REPORTER_ASSERT(reporter, info1.fLocalMat.isIdentity()); |
| 996 REPORTER_ASSERT(reporter, info1.fPreMat.isIdentity()); |
995 REPORTER_ASSERT(reporter, 0 == info1.fBounds.fLeft && 0 == info1.fBo
unds.fTop); | 997 REPORTER_ASSERT(reporter, 0 == info1.fBounds.fLeft && 0 == info1.fBo
unds.fTop); |
996 REPORTER_ASSERT(reporter, NULL == info1.fPaint); | 998 REPORTER_ASSERT(reporter, NULL == info1.fPaint); |
997 REPORTER_ASSERT(reporter, !info1.fIsNested && | 999 REPORTER_ASSERT(reporter, !info1.fIsNested && |
998 info1.fHasNestedLayers); // has a nested S
L | 1000 info1.fHasNestedLayers); // has a nested S
L |
999 | 1001 |
1000 REPORTER_ASSERT(reporter, NULL == info2.fPicture); | 1002 REPORTER_ASSERT(reporter, NULL == info2.fPicture); |
1001 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fBounds.width() && | 1003 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fBounds.width() && |
1002 kHeight / 2 == info2.fBounds.height()); //
bound reduces size | 1004 kHeight / 2 == info2.fBounds.height()); //
bound reduces size |
1003 REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity()); | 1005 REPORTER_ASSERT(reporter, !info2.fLocalMat.isIdentity()); |
| 1006 REPORTER_ASSERT(reporter, info2.fPreMat.isIdentity()); |
1004 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fBounds.fLeft && //
translated | 1007 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fBounds.fLeft && //
translated |
1005 kHeight / 2 == info2.fBounds.fTop); | 1008 kHeight / 2 == info2.fBounds.fTop); |
1006 REPORTER_ASSERT(reporter, NULL == info1.fPaint); | 1009 REPORTER_ASSERT(reporter, NULL == info1.fPaint); |
1007 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers
); // is nested | 1010 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers
); // is nested |
1008 | 1011 |
1009 REPORTER_ASSERT(reporter, NULL == info3.fPicture); | 1012 REPORTER_ASSERT(reporter, NULL == info3.fPicture); |
1010 REPORTER_ASSERT(reporter, kWidth == info3.fBounds.width() && | 1013 REPORTER_ASSERT(reporter, kWidth == info3.fBounds.width() && |
1011 kHeight == info3.fBounds.height()); | 1014 kHeight == info3.fBounds.height()); |
1012 REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity()); | 1015 REPORTER_ASSERT(reporter, info3.fLocalMat.isIdentity()); |
| 1016 REPORTER_ASSERT(reporter, info3.fPreMat.isIdentity()); |
1013 REPORTER_ASSERT(reporter, 0 == info3.fBounds.fLeft && 0 == info3.fBo
unds.fTop); | 1017 REPORTER_ASSERT(reporter, 0 == info3.fBounds.fLeft && 0 == info3.fBo
unds.fTop); |
1014 REPORTER_ASSERT(reporter, info3.fPaint); | 1018 REPORTER_ASSERT(reporter, info3.fPaint); |
1015 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer
s); | 1019 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer
s); |
1016 | 1020 |
1017 REPORTER_ASSERT(reporter, NULL == info4.fPicture); | 1021 REPORTER_ASSERT(reporter, NULL == info4.fPicture); |
1018 REPORTER_ASSERT(reporter, kWidth == info4.fBounds.width() && | 1022 REPORTER_ASSERT(reporter, kWidth == info4.fBounds.width() && |
1019 kHeight == info4.fBounds.height()); | 1023 kHeight == info4.fBounds.height()); |
1020 REPORTER_ASSERT(reporter, 0 == info4.fBounds.fLeft && 0 == info4.fBo
unds.fTop); | 1024 REPORTER_ASSERT(reporter, 0 == info4.fBounds.fLeft && 0 == info4.fBo
unds.fTop); |
1021 REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity()); | 1025 REPORTER_ASSERT(reporter, info4.fLocalMat.isIdentity()); |
| 1026 REPORTER_ASSERT(reporter, info4.fPreMat.isIdentity()); |
1022 REPORTER_ASSERT(reporter, info4.fPaint); | 1027 REPORTER_ASSERT(reporter, info4.fPaint); |
1023 REPORTER_ASSERT(reporter, !info4.fIsNested && | 1028 REPORTER_ASSERT(reporter, !info4.fIsNested && |
1024 info4.fHasNestedLayers); // has a nested S
L | 1029 info4.fHasNestedLayers); // has a nested S
L |
1025 | 1030 |
1026 REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child pi
cture | 1031 REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child pi
cture |
1027 REPORTER_ASSERT(reporter, kWidth == info5.fBounds.width() && | 1032 REPORTER_ASSERT(reporter, kWidth == info5.fBounds.width() && |
1028 kHeight == info5.fBounds.height()); | 1033 kHeight == info5.fBounds.height()); |
1029 REPORTER_ASSERT(reporter, 0 == info5.fBounds.fLeft && 0 == info5.fBo
unds.fTop); | 1034 REPORTER_ASSERT(reporter, 0 == info5.fBounds.fLeft && 0 == info5.fBo
unds.fTop); |
1030 REPORTER_ASSERT(reporter, info5.fOriginXform.isIdentity()); | 1035 REPORTER_ASSERT(reporter, info5.fLocalMat.isIdentity()); |
| 1036 REPORTER_ASSERT(reporter, info5.fPreMat.isIdentity()); |
1031 REPORTER_ASSERT(reporter, NULL == info5.fPaint); | 1037 REPORTER_ASSERT(reporter, NULL == info5.fPaint); |
1032 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers
); // is nested | 1038 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers
); // is nested |
1033 | 1039 |
1034 REPORTER_ASSERT(reporter, NULL == info6.fPicture); | 1040 REPORTER_ASSERT(reporter, NULL == info6.fPicture); |
1035 REPORTER_ASSERT(reporter, kWidth == info6.fBounds.width() && | 1041 REPORTER_ASSERT(reporter, kWidth == info6.fBounds.width() && |
1036 kHeight == info6.fBounds.height()); | 1042 kHeight == info6.fBounds.height()); |
1037 REPORTER_ASSERT(reporter, 0 == info6.fBounds.fLeft && 0 == info6.fBo
unds.fTop); | 1043 REPORTER_ASSERT(reporter, 0 == info6.fBounds.fLeft && 0 == info6.fBo
unds.fTop); |
1038 REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity()); | 1044 REPORTER_ASSERT(reporter, info6.fLocalMat.isIdentity()); |
| 1045 REPORTER_ASSERT(reporter, info6.fPreMat.isIdentity()); |
1039 REPORTER_ASSERT(reporter, info6.fPaint); | 1046 REPORTER_ASSERT(reporter, info6.fPaint); |
1040 REPORTER_ASSERT(reporter, !info6.fIsNested && | 1047 REPORTER_ASSERT(reporter, !info6.fIsNested && |
1041 info6.fHasNestedLayers); // has a nested S
L | 1048 info6.fHasNestedLayers); // has a nested S
L |
1042 | 1049 |
1043 REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child pi
cture | 1050 REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child pi
cture |
1044 REPORTER_ASSERT(reporter, kWidth == info7.fBounds.width() && | 1051 REPORTER_ASSERT(reporter, kWidth == info7.fBounds.width() && |
1045 kHeight == info7.fBounds.height()); | 1052 kHeight == info7.fBounds.height()); |
1046 REPORTER_ASSERT(reporter, 0 == info7.fBounds.fLeft && 0 == info7.fBo
unds.fTop); | 1053 REPORTER_ASSERT(reporter, 0 == info7.fBounds.fLeft && 0 == info7.fBo
unds.fTop); |
1047 REPORTER_ASSERT(reporter, info7.fOriginXform.isIdentity()); | 1054 REPORTER_ASSERT(reporter, info7.fLocalMat.isIdentity()); |
| 1055 REPORTER_ASSERT(reporter, info7.fPreMat.isIdentity()); |
1048 REPORTER_ASSERT(reporter, NULL == info7.fPaint); | 1056 REPORTER_ASSERT(reporter, NULL == info7.fPaint); |
1049 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers
); // is nested | 1057 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers
); // is nested |
1050 } | 1058 } |
1051 } | 1059 } |
1052 } | 1060 } |
1053 | 1061 |
1054 #endif | 1062 #endif |
1055 | 1063 |
1056 static void test_has_text(skiatest::Reporter* reporter) { | 1064 static void test_has_text(skiatest::Reporter* reporter) { |
1057 SkPictureRecorder recorder; | 1065 SkPictureRecorder recorder; |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 | 1920 |
1913 // The picture shares the immutable pixels but copies the mutable ones. | 1921 // The picture shares the immutable pixels but copies the mutable ones. |
1914 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1922 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1915 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); | 1923 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); |
1916 | 1924 |
1917 // When the picture goes away, it's just our bitmaps holding the refs. | 1925 // When the picture goes away, it's just our bitmaps holding the refs. |
1918 pic.reset(NULL); | 1926 pic.reset(NULL); |
1919 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1927 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1920 REPORTER_ASSERT(r, immut.pixelRef()->unique()); | 1928 REPORTER_ASSERT(r, immut.pixelRef()->unique()); |
1921 } | 1929 } |
OLD | NEW |