aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-12-22 11:58:30 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-22 11:58:30 -0800
commitd990e2f14f14c36c3d0beb303dd0953c7aa1fcfa (patch)
tree28b10e1df0c6709bff31faff6a4535d4734c6693 /tests
parent39edf7664f50b6c890b933b5bbed67a8735b349b (diff)
add testing flag to ignore saveLayer bounds
Diffstat (limited to 'tests')
-rw-r--r--tests/PictureTest.cpp2
-rw-r--r--tests/RecordDrawTest.cpp8
-rw-r--r--tests/RecordOptsTest.cpp4
3 files changed, 9 insertions, 5 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index b98cc4680e..a66185b95b 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -974,7 +974,7 @@ static void test_savelayer_extraction(skiatest::Reporter* reporter) {
}
// Now test out the SaveLayer extraction
- {
+ if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) {
SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey();
const SkPicture::AccelData* data = pict->EXPERIMENTAL_getAccelData(key);
diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp
index e830af4b43..d306cad6e9 100644
--- a/tests/RecordDrawTest.cpp
+++ b/tests/RecordDrawTest.cpp
@@ -275,9 +275,11 @@ DEF_TEST(RecordDraw_SaveLayerBoundsAffectsClipBounds, r) {
TestBBH bbh;
SkRecordFillBounds(SkRect::MakeWH(50, 50), record, &bbh);
REPORTER_ASSERT(r, bbh.fEntries.count() == 3);
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(10, 10, 40, 40)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(20, 20, 30, 30)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[2].bounds, SkRect::MakeLTRB(10, 10, 40, 40)));
+ if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) {
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(10, 10, 40, 40)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(20, 20, 30, 30)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[2].bounds, SkRect::MakeLTRB(10, 10, 40, 40)));
+ }
}
DEF_TEST(RecordDraw_drawImage, r){
diff --git a/tests/RecordOptsTest.cpp b/tests/RecordOptsTest.cpp
index cdc0350e53..dd5035b216 100644
--- a/tests/RecordOptsTest.cpp
+++ b/tests/RecordOptsTest.cpp
@@ -131,7 +131,9 @@ DEF_TEST(RecordOpts_NoopSaveLayerDrawRestore, r) {
recorder.saveLayer(&bounds, NULL);
recorder.drawRect(draw, goodDrawPaint);
recorder.restore();
- assert_savelayer_restore(r, &record, 0, false);
+ if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) {
+ assert_savelayer_restore(r, &record, 0, false);
+ }
// SaveLayer/Restore removed: no bounds + no paint = no point.
recorder.saveLayer(NULL, NULL);