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

Unified Diff: tests/PictureTest.cpp

Issue 551853002: Turn on the save-layer optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecordOpts.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 8755440e0b0ea171e893b6d8e9bf80c8a2d63161..05aec092c3254fa83a8d102a01fd4ebcdb7c99b2 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -935,20 +935,23 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
c->saveLayer(NULL, &p); // layer #3
c->restore();
}
+
+ SkPaint layerPaint;
+ layerPaint.setColor(SK_ColorRED); // Non-alpha only to avoid SaveLayerDrawRestoreNooper
// 4)
{
- c->saveLayer(NULL, NULL); // layer #4
+ c->saveLayer(NULL, &layerPaint); // layer #4
c->drawPicture(child); // layer #5 inside picture
c->restore();
}
// 5
{
- SkPaint p;
+ SkPaint picturePaint;
SkMatrix trans;
trans.setTranslate(10, 10);
- c->saveLayer(NULL, NULL); // layer #6
- c->drawPicture(child, &trans, &p); // layer #7 inside picture
+ c->saveLayer(NULL, &layerPaint); // layer #6
+ c->drawPicture(child, &trans, &picturePaint); // layer #7 inside picture
c->restore();
}
@@ -1032,7 +1035,7 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
kHeight == info4.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info4.fOffset.fX && 0 == info4.fOffset.fY);
REPORTER_ASSERT(reporter, info4.fOriginXform.isIdentity());
- REPORTER_ASSERT(reporter, NULL == info4.fPaint);
+ REPORTER_ASSERT(reporter, info4.fPaint);
REPORTER_ASSERT(reporter, !info4.fIsNested &&
info4.fHasNestedLayers); // has a nested SL
@@ -1051,7 +1054,7 @@ static void test_gpu_picture_optimization(skiatest::Reporter* reporter,
kHeight == info6.fSize.fHeight);
REPORTER_ASSERT(reporter, 0 == info6.fOffset.fX && 0 == info6.fOffset.fY);
REPORTER_ASSERT(reporter, info6.fOriginXform.isIdentity());
- REPORTER_ASSERT(reporter, NULL == info6.fPaint);
+ REPORTER_ASSERT(reporter, info6.fPaint);
REPORTER_ASSERT(reporter, !info6.fIsNested &&
info6.fHasNestedLayers); // has a nested SL
« no previous file with comments | « src/core/SkRecordOpts.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698