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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 const GrAccelData::SaveLayerInfo& info3 = gpuData->saveLayerInfo(3); | 973 const GrAccelData::SaveLayerInfo& info3 = gpuData->saveLayerInfo(3); |
974 | 974 |
975 // The parent/child layers appear in reverse order | 975 // The parent/child layers appear in reverse order |
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, info0.fValid); | |
984 REPORTER_ASSERT(reporter, NULL == info0.fPicture); | 983 REPORTER_ASSERT(reporter, NULL == info0.fPicture); |
985 REPORTER_ASSERT(reporter, kWidth == info0.fSize.fWidth && | 984 REPORTER_ASSERT(reporter, kWidth == info0.fSize.fWidth && |
986 kHeight == info0.fSize.fHeight); | 985 kHeight == info0.fSize.fHeight); |
987 REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity()); | 986 REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity()); |
988 REPORTER_ASSERT(reporter, 0 == info0.fOffset.fX && 0 == info0.fOffse
t.fY); | 987 REPORTER_ASSERT(reporter, 0 == info0.fOffset.fX && 0 == info0.fOffse
t.fY); |
989 REPORTER_ASSERT(reporter, NULL == info0.fPaint); | 988 REPORTER_ASSERT(reporter, NULL == info0.fPaint); |
990 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer
s); | 989 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer
s); |
991 | 990 |
992 REPORTER_ASSERT(reporter, info1.fValid); | |
993 REPORTER_ASSERT(reporter, NULL == info1.fPicture); | 991 REPORTER_ASSERT(reporter, NULL == info1.fPicture); |
994 REPORTER_ASSERT(reporter, kWidth == info1.fSize.fWidth && | 992 REPORTER_ASSERT(reporter, kWidth == info1.fSize.fWidth && |
995 kHeight == info1.fSize.fHeight); | 993 kHeight == info1.fSize.fHeight); |
996 REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity()); | 994 REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity()); |
997 REPORTER_ASSERT(reporter, 0 == info1.fOffset.fX && 0 == info1.fOffse
t.fY); | 995 REPORTER_ASSERT(reporter, 0 == info1.fOffset.fX && 0 == info1.fOffse
t.fY); |
998 REPORTER_ASSERT(reporter, NULL == info1.fPaint); | 996 REPORTER_ASSERT(reporter, NULL == info1.fPaint); |
999 REPORTER_ASSERT(reporter, !info1.fIsNested && | 997 REPORTER_ASSERT(reporter, !info1.fIsNested && |
1000 info1.fHasNestedLayers); // has a nested S
L | 998 info1.fHasNestedLayers); // has a nested S
L |
1001 | 999 |
1002 REPORTER_ASSERT(reporter, info2.fValid); | |
1003 REPORTER_ASSERT(reporter, NULL == info2.fPicture); | 1000 REPORTER_ASSERT(reporter, NULL == info2.fPicture); |
1004 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fSize.fWidth && | 1001 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fSize.fWidth && |
1005 kHeight/2 == info2.fSize.fHeight); // boun
d reduces size | 1002 kHeight/2 == info2.fSize.fHeight); // boun
d reduces size |
1006 REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity()); | 1003 REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity()); |
1007 REPORTER_ASSERT(reporter, kWidth/2 == info2.fOffset.fX && // trans
lated | 1004 REPORTER_ASSERT(reporter, kWidth/2 == info2.fOffset.fX && // trans
lated |
1008 kHeight/2 == info2.fOffset.fY); | 1005 kHeight/2 == info2.fOffset.fY); |
1009 REPORTER_ASSERT(reporter, NULL == info1.fPaint); | 1006 REPORTER_ASSERT(reporter, NULL == info1.fPaint); |
1010 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers
); // is nested | 1007 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers
); // is nested |
1011 | 1008 |
1012 REPORTER_ASSERT(reporter, info3.fValid); | |
1013 REPORTER_ASSERT(reporter, NULL == info3.fPicture); | 1009 REPORTER_ASSERT(reporter, NULL == info3.fPicture); |
1014 REPORTER_ASSERT(reporter, kWidth == info3.fSize.fWidth && | 1010 REPORTER_ASSERT(reporter, kWidth == info3.fSize.fWidth && |
1015 kHeight == info3.fSize.fHeight); | 1011 kHeight == info3.fSize.fHeight); |
1016 REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity()); | 1012 REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity()); |
1017 REPORTER_ASSERT(reporter, 0 == info3.fOffset.fX && 0 == info3.fOffse
t.fY); | 1013 REPORTER_ASSERT(reporter, 0 == info3.fOffset.fX && 0 == info3.fOffse
t.fY); |
1018 REPORTER_ASSERT(reporter, info3.fPaint); | 1014 REPORTER_ASSERT(reporter, info3.fPaint); |
1019 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer
s); | 1015 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer
s); |
1020 | 1016 |
1021 REPORTER_ASSERT(reporter, info4.fValid); | |
1022 REPORTER_ASSERT(reporter, NULL == info4.fPicture); | 1017 REPORTER_ASSERT(reporter, NULL == info4.fPicture); |
1023 REPORTER_ASSERT(reporter, kWidth == info4.fSize.fWidth && | 1018 REPORTER_ASSERT(reporter, kWidth == info4.fSize.fWidth && |
1024 kHeight == info4.fSize.fHeight); | 1019 kHeight == info4.fSize.fHeight); |
1025 REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffse
t.fY); | 1020 REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffse
t.fY); |
1026 REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity()); | 1021 REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity()); |
1027 REPORTER_ASSERT(reporter, info4.fPaint); | 1022 REPORTER_ASSERT(reporter, info4.fPaint); |
1028 REPORTER_ASSERT(reporter, !info4.fIsNested && | 1023 REPORTER_ASSERT(reporter, !info4.fIsNested && |
1029 info4.fHasNestedLayers); // has a nested S
L | 1024 info4.fHasNestedLayers); // has a nested S
L |
1030 | 1025 |
1031 REPORTER_ASSERT(reporter, info5.fValid); | |
1032 REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child pi
cture | 1026 REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child pi
cture |
1033 REPORTER_ASSERT(reporter, kWidth == info5.fSize.fWidth && | 1027 REPORTER_ASSERT(reporter, kWidth == info5.fSize.fWidth && |
1034 kHeight == info5.fSize.fHeight); | 1028 kHeight == info5.fSize.fHeight); |
1035 REPORTER_ASSERT(reporter, 0 == info5.fOffset.fX && 0 == info5.fOffse
t.fY); | 1029 REPORTER_ASSERT(reporter, 0 == info5.fOffset.fX && 0 == info5.fOffse
t.fY); |
1036 REPORTER_ASSERT(reporter, info5.fOriginXform.isIdentity()); | 1030 REPORTER_ASSERT(reporter, info5.fOriginXform.isIdentity()); |
1037 REPORTER_ASSERT(reporter, NULL == info5.fPaint); | 1031 REPORTER_ASSERT(reporter, NULL == info5.fPaint); |
1038 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers
); // is nested | 1032 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers
); // is nested |
1039 | 1033 |
1040 REPORTER_ASSERT(reporter, info6.fValid); | |
1041 REPORTER_ASSERT(reporter, NULL == info6.fPicture); | 1034 REPORTER_ASSERT(reporter, NULL == info6.fPicture); |
1042 REPORTER_ASSERT(reporter, kWidth == info6.fSize.fWidth && | 1035 REPORTER_ASSERT(reporter, kWidth == info6.fSize.fWidth && |
1043 kHeight == info6.fSize.fHeight); | 1036 kHeight == info6.fSize.fHeight); |
1044 REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffse
t.fY); | 1037 REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffse
t.fY); |
1045 REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity()); | 1038 REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity()); |
1046 REPORTER_ASSERT(reporter, info6.fPaint); | 1039 REPORTER_ASSERT(reporter, info6.fPaint); |
1047 REPORTER_ASSERT(reporter, !info6.fIsNested && | 1040 REPORTER_ASSERT(reporter, !info6.fIsNested && |
1048 info6.fHasNestedLayers); // has a nested S
L | 1041 info6.fHasNestedLayers); // has a nested S
L |
1049 | 1042 |
1050 REPORTER_ASSERT(reporter, info7.fValid); | |
1051 REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child pi
cture | 1043 REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child pi
cture |
1052 REPORTER_ASSERT(reporter, kWidth == info7.fSize.fWidth && | 1044 REPORTER_ASSERT(reporter, kWidth == info7.fSize.fWidth && |
1053 kHeight == info7.fSize.fHeight); | 1045 kHeight == info7.fSize.fHeight); |
1054 REPORTER_ASSERT(reporter, 0 == info7.fOffset.fX && 0 == info7.fOffse
t.fY); | 1046 REPORTER_ASSERT(reporter, 0 == info7.fOffset.fX && 0 == info7.fOffse
t.fY); |
1055 REPORTER_ASSERT(reporter, info7.fOriginXform.isIdentity()); | 1047 REPORTER_ASSERT(reporter, info7.fOriginXform.isIdentity()); |
1056 REPORTER_ASSERT(reporter, NULL == info7.fPaint); | 1048 REPORTER_ASSERT(reporter, NULL == info7.fPaint); |
1057 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers
); // is nested | 1049 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers
); // is nested |
1058 } | 1050 } |
1059 } | 1051 } |
1060 } | 1052 } |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 | 1912 |
1921 // The picture shares the immutable pixels but copies the mutable ones. | 1913 // The picture shares the immutable pixels but copies the mutable ones. |
1922 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1914 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1923 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); | 1915 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); |
1924 | 1916 |
1925 // When the picture goes away, it's just our bitmaps holding the refs. | 1917 // When the picture goes away, it's just our bitmaps holding the refs. |
1926 pic.reset(NULL); | 1918 pic.reset(NULL); |
1927 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1919 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1928 REPORTER_ASSERT(r, immut.pixelRef()->unique()); | 1920 REPORTER_ASSERT(r, immut.pixelRef()->unique()); |
1929 } | 1921 } |
OLD | NEW |