Update layer hoisting code to correctly render sub-picture layers
The prior code assumed all layers came from a single picture.
BUG=skia:2315
R=bsalomon@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/595543002
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index ca2d620..9cd63df 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -992,7 +992,7 @@
const GrAccelData::SaveLayerInfo& info7 = gpuData->saveLayerInfo(6);
REPORTER_ASSERT(reporter, info0.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info0.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info0.fPicture);
REPORTER_ASSERT(reporter, kWidth == info0.fSize.fWidth &&
kHeight == info0.fSize.fHeight);
REPORTER_ASSERT(reporter, info0.fOriginXform.isIdentity());
@@ -1001,7 +1001,7 @@
REPORTER_ASSERT(reporter, !info0.fIsNested && !info0.fHasNestedLayers);
REPORTER_ASSERT(reporter, info1.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info1.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info1.fPicture);
REPORTER_ASSERT(reporter, kWidth == info1.fSize.fWidth &&
kHeight == info1.fSize.fHeight);
REPORTER_ASSERT(reporter, info1.fOriginXform.isIdentity());
@@ -1011,7 +1011,7 @@
info1.fHasNestedLayers); // has a nested SL
REPORTER_ASSERT(reporter, info2.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info2.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info2.fPicture);
REPORTER_ASSERT(reporter, kWidth / 2 == info2.fSize.fWidth &&
kHeight/2 == info2.fSize.fHeight); // bound reduces size
REPORTER_ASSERT(reporter, !info2.fOriginXform.isIdentity());
@@ -1021,7 +1021,7 @@
REPORTER_ASSERT(reporter, info2.fIsNested && !info2.fHasNestedLayers); // is nested
REPORTER_ASSERT(reporter, info3.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info3.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info3.fPicture);
REPORTER_ASSERT(reporter, kWidth == info3.fSize.fWidth &&
kHeight == info3.fSize.fHeight);
REPORTER_ASSERT(reporter, info3.fOriginXform.isIdentity());
@@ -1030,7 +1030,7 @@
REPORTER_ASSERT(reporter, !info3.fIsNested && !info3.fHasNestedLayers);
REPORTER_ASSERT(reporter, info4.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info4.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info4.fPicture);
REPORTER_ASSERT(reporter, kWidth == info4.fSize.fWidth &&
kHeight == info4.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffset.fY);
@@ -1040,7 +1040,7 @@
info4.fHasNestedLayers); // has a nested SL
REPORTER_ASSERT(reporter, info5.fValid);
- REPORTER_ASSERT(reporter, child->uniqueID() == info5.fPictureID); // in a child picture
+ REPORTER_ASSERT(reporter, child == info5.fPicture); // in a child picture
REPORTER_ASSERT(reporter, kWidth == info5.fSize.fWidth &&
kHeight == info5.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info5.fOffset.fX && 0 == info5.fOffset.fY);
@@ -1049,7 +1049,7 @@
REPORTER_ASSERT(reporter, info5.fIsNested && !info5.fHasNestedLayers); // is nested
REPORTER_ASSERT(reporter, info6.fValid);
- REPORTER_ASSERT(reporter, pict->uniqueID() == info6.fPictureID);
+ REPORTER_ASSERT(reporter, NULL == info6.fPicture);
REPORTER_ASSERT(reporter, kWidth == info6.fSize.fWidth &&
kHeight == info6.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffset.fY);
@@ -1059,7 +1059,7 @@
info6.fHasNestedLayers); // has a nested SL
REPORTER_ASSERT(reporter, info7.fValid);
- REPORTER_ASSERT(reporter, child->uniqueID() == info7.fPictureID); // in a child picture
+ REPORTER_ASSERT(reporter, child == info7.fPicture); // in a child picture
REPORTER_ASSERT(reporter, kWidth == info7.fSize.fWidth &&
kHeight == info7.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info7.fOffset.fX && 0 == info7.fOffset.fY);