Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: tests/PictureTest.cpp

Issue 595543002: Update layer hoisting code to correctly render sub-picture layers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add cast Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 985
986 // The parent/child layers appear in reverse order 986 // The parent/child layers appear in reverse order
987 const GrAccelData::SaveLayerInfo& info4 = gpuData->saveLayerInfo(5); 987 const GrAccelData::SaveLayerInfo& info4 = gpuData->saveLayerInfo(5);
988 const GrAccelData::SaveLayerInfo& info5 = gpuData->saveLayerInfo(4); 988 const GrAccelData::SaveLayerInfo& info5 = gpuData->saveLayerInfo(4);
989 989
990 // The parent/child layers appear in reverse order 990 // The parent/child layers appear in reverse order
991 const GrAccelData::SaveLayerInfo& info6 = gpuData->saveLayerInfo(7); 991 const GrAccelData::SaveLayerInfo& info6 = gpuData->saveLayerInfo(7);
992 const GrAccelData::SaveLayerInfo& info7 = gpuData->saveLayerInfo(6); 992 const GrAccelData::SaveLayerInfo& info7 = gpuData->saveLayerInfo(6);
993 993
994 REPORTER_ASSERT(reporter, info0.fValid); 994 REPORTER_ASSERT(reporter, info0.fValid);
995 REPORTER_ASSERT(reporter, pict->uniqueID() == info0.fPictureID); 995 REPORTER_ASSERT(reporter, NULL == info0.fPicture);
996 REPORTER_ASSERT(reporter, kWidth == info0.fSize.fWidth && 996 REPORTER_ASSERT(reporter, kWidth == info0.fSize.fWidth &&
997 kHeight == info0.fSize.fHeight); 997 kHeight == info0.fSize.fHeight);
998 REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity()); 998 REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity());
999 REPORTER_ASSERT(reporter, 0 == info0.fOffset.fX && 0 == info0.fOffse t.fY); 999 REPORTER_ASSERT(reporter, 0 == info0.fOffset.fX && 0 == info0.fOffse t.fY);
1000 REPORTER_ASSERT(reporter, NULL == info0.fPaint); 1000 REPORTER_ASSERT(reporter, NULL == info0.fPaint);
1001 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer s); 1001 REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayer s);
1002 1002
1003 REPORTER_ASSERT(reporter, info1.fValid); 1003 REPORTER_ASSERT(reporter, info1.fValid);
1004 REPORTER_ASSERT(reporter, pict->uniqueID() == info1.fPictureID); 1004 REPORTER_ASSERT(reporter, NULL == info1.fPicture);
1005 REPORTER_ASSERT(reporter, kWidth == info1.fSize.fWidth && 1005 REPORTER_ASSERT(reporter, kWidth == info1.fSize.fWidth &&
1006 kHeight == info1.fSize.fHeight); 1006 kHeight == info1.fSize.fHeight);
1007 REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity()); 1007 REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity());
1008 REPORTER_ASSERT(reporter, 0 == info1.fOffset.fX && 0 == info1.fOffse t.fY); 1008 REPORTER_ASSERT(reporter, 0 == info1.fOffset.fX && 0 == info1.fOffse t.fY);
1009 REPORTER_ASSERT(reporter, NULL == info1.fPaint); 1009 REPORTER_ASSERT(reporter, NULL == info1.fPaint);
1010 REPORTER_ASSERT(reporter, !info1.fIsNested && 1010 REPORTER_ASSERT(reporter, !info1.fIsNested &&
1011 info1.fHasNestedLayers); // has a nested S L 1011 info1.fHasNestedLayers); // has a nested S L
1012 1012
1013 REPORTER_ASSERT(reporter, info2.fValid); 1013 REPORTER_ASSERT(reporter, info2.fValid);
1014 REPORTER_ASSERT(reporter, pict->uniqueID() == info2.fPictureID); 1014 REPORTER_ASSERT(reporter, NULL == info2.fPicture);
1015 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fSize.fWidth && 1015 REPORTER_ASSERT(reporter, kWidth / 2 == info2.fSize.fWidth &&
1016 kHeight/2 == info2.fSize.fHeight); // boun d reduces size 1016 kHeight/2 == info2.fSize.fHeight); // boun d reduces size
1017 REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity()); 1017 REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity());
1018 REPORTER_ASSERT(reporter, kWidth/2 == info2.fOffset.fX && // trans lated 1018 REPORTER_ASSERT(reporter, kWidth/2 == info2.fOffset.fX && // trans lated
1019 kHeight/2 == info2.fOffset.fY); 1019 kHeight/2 == info2.fOffset.fY);
1020 REPORTER_ASSERT(reporter, NULL == info1.fPaint); 1020 REPORTER_ASSERT(reporter, NULL == info1.fPaint);
1021 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers ); // is nested 1021 REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers ); // is nested
1022 1022
1023 REPORTER_ASSERT(reporter, info3.fValid); 1023 REPORTER_ASSERT(reporter, info3.fValid);
1024 REPORTER_ASSERT(reporter, pict->uniqueID() == info3.fPictureID); 1024 REPORTER_ASSERT(reporter, NULL == info3.fPicture);
1025 REPORTER_ASSERT(reporter, kWidth == info3.fSize.fWidth && 1025 REPORTER_ASSERT(reporter, kWidth == info3.fSize.fWidth &&
1026 kHeight == info3.fSize.fHeight); 1026 kHeight == info3.fSize.fHeight);
1027 REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity()); 1027 REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity());
1028 REPORTER_ASSERT(reporter, 0 == info3.fOffset.fX && 0 == info3.fOffse t.fY); 1028 REPORTER_ASSERT(reporter, 0 == info3.fOffset.fX && 0 == info3.fOffse t.fY);
1029 REPORTER_ASSERT(reporter, info3.fPaint); 1029 REPORTER_ASSERT(reporter, info3.fPaint);
1030 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer s); 1030 REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayer s);
1031 1031
1032 REPORTER_ASSERT(reporter, info4.fValid); 1032 REPORTER_ASSERT(reporter, info4.fValid);
1033 REPORTER_ASSERT(reporter, pict->uniqueID() == info4.fPictureID); 1033 REPORTER_ASSERT(reporter, NULL == info4.fPicture);
1034 REPORTER_ASSERT(reporter, kWidth == info4.fSize.fWidth && 1034 REPORTER_ASSERT(reporter, kWidth == info4.fSize.fWidth &&
1035 kHeight == info4.fSize.fHeight); 1035 kHeight == info4.fSize.fHeight);
1036 REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffse t.fY); 1036 REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffse t.fY);
1037 REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity()); 1037 REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity());
1038 REPORTER_ASSERT(reporter, info4.fPaint); 1038 REPORTER_ASSERT(reporter, info4.fPaint);
1039 REPORTER_ASSERT(reporter, !info4.fIsNested && 1039 REPORTER_ASSERT(reporter, !info4.fIsNested &&
1040 info4.fHasNestedLayers); // has a nested S L 1040 info4.fHasNestedLayers); // has a nested S L
1041 1041
1042 REPORTER_ASSERT(reporter, info5.fValid); 1042 REPORTER_ASSERT(reporter, info5.fValid);
1043 REPORTER_ASSERT(reporter, child->uniqueID() == info5.fPictureID); // in a child picture 1043 REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child pi cture
1044 REPORTER_ASSERT(reporter, kWidth == info5.fSize.fWidth && 1044 REPORTER_ASSERT(reporter, kWidth == info5.fSize.fWidth &&
1045 kHeight == info5.fSize.fHeight); 1045 kHeight == info5.fSize.fHeight);
1046 REPORTER_ASSERT(reporter, 0 == info5.fOffset.fX && 0 == info5.fOffse t.fY); 1046 REPORTER_ASSERT(reporter, 0 == info5.fOffset.fX && 0 == info5.fOffse t.fY);
1047 REPORTER_ASSERT(reporter, info5.fOriginXform.isIdentity()); 1047 REPORTER_ASSERT(reporter, info5.fOriginXform.isIdentity());
1048 REPORTER_ASSERT(reporter, NULL == info5.fPaint); 1048 REPORTER_ASSERT(reporter, NULL == info5.fPaint);
1049 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers ); // is nested 1049 REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers ); // is nested
1050 1050
1051 REPORTER_ASSERT(reporter, info6.fValid); 1051 REPORTER_ASSERT(reporter, info6.fValid);
1052 REPORTER_ASSERT(reporter, pict->uniqueID() == info6.fPictureID); 1052 REPORTER_ASSERT(reporter, NULL == info6.fPicture);
1053 REPORTER_ASSERT(reporter, kWidth == info6.fSize.fWidth && 1053 REPORTER_ASSERT(reporter, kWidth == info6.fSize.fWidth &&
1054 kHeight == info6.fSize.fHeight); 1054 kHeight == info6.fSize.fHeight);
1055 REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffse t.fY); 1055 REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffse t.fY);
1056 REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity()); 1056 REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity());
1057 REPORTER_ASSERT(reporter, info6.fPaint); 1057 REPORTER_ASSERT(reporter, info6.fPaint);
1058 REPORTER_ASSERT(reporter, !info6.fIsNested && 1058 REPORTER_ASSERT(reporter, !info6.fIsNested &&
1059 info6.fHasNestedLayers); // has a nested S L 1059 info6.fHasNestedLayers); // has a nested S L
1060 1060
1061 REPORTER_ASSERT(reporter, info7.fValid); 1061 REPORTER_ASSERT(reporter, info7.fValid);
1062 REPORTER_ASSERT(reporter, child->uniqueID() == info7.fPictureID); // in a child picture 1062 REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child pi cture
1063 REPORTER_ASSERT(reporter, kWidth == info7.fSize.fWidth && 1063 REPORTER_ASSERT(reporter, kWidth == info7.fSize.fWidth &&
1064 kHeight == info7.fSize.fHeight); 1064 kHeight == info7.fSize.fHeight);
1065 REPORTER_ASSERT(reporter, 0 == info7.fOffset.fX && 0 == info7.fOffse t.fY); 1065 REPORTER_ASSERT(reporter, 0 == info7.fOffset.fX && 0 == info7.fOffse t.fY);
1066 REPORTER_ASSERT(reporter, info7.fOriginXform.isIdentity()); 1066 REPORTER_ASSERT(reporter, info7.fOriginXform.isIdentity());
1067 REPORTER_ASSERT(reporter, NULL == info7.fPaint); 1067 REPORTER_ASSERT(reporter, NULL == info7.fPaint);
1068 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers ); // is nested 1068 REPORTER_ASSERT(reporter, info7.fIsNested && !info7.fHasNestedLayers ); // is nested
1069 } 1069 }
1070 } 1070 }
1071 } 1071 }
1072 1072
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 1946
1947 // The picture shares the immutable pixels but copies the mutable ones. 1947 // The picture shares the immutable pixels but copies the mutable ones.
1948 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1948 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1949 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); 1949 REPORTER_ASSERT(r, !immut.pixelRef()->unique());
1950 1950
1951 // When the picture goes away, it's just our bitmaps holding the refs. 1951 // When the picture goes away, it's just our bitmaps holding the refs.
1952 pic.reset(NULL); 1952 pic.reset(NULL);
1953 REPORTER_ASSERT(r, mut.pixelRef()->unique()); 1953 REPORTER_ASSERT(r, mut.pixelRef()->unique());
1954 REPORTER_ASSERT(r, immut.pixelRef()->unique()); 1954 REPORTER_ASSERT(r, immut.pixelRef()->unique());
1955 } 1955 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698