static void test_peephole(skiatest::Reporter* reporter) { SkRandom rand; for (int j = 0; j < 100; j++) { SkRandom rand2(rand.getSeed()); // remember the seed SkPicture picture; SkCanvas* canvas = picture.beginRecording(100, 100); for (int i = 0; i < 1000; ++i) { rand_op(canvas, rand); } picture.endRecording(); } { SkPicture picture; SkCanvas* canvas = picture.beginRecording(100, 100); SkRect rect = SkRect::MakeWH(50, 50); for (int i = 0; i < 100; ++i) { canvas->save(); } while (canvas->getSaveCount() > 1) { canvas->clipRect(rect); canvas->restore(); } picture.endRecording(); } }