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

Side by Side Diff: tests/PictureBBHTest.cpp

Issue 767333002: Defer saves() until they're needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update tests Created 6 years 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/core/SkPictureRecord.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkBBoxHierarchy.h" 9 #include "SkBBoxHierarchy.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 SkAutoTUnref<SkPicture> srcPic(src.endRecording()); 112 SkAutoTUnref<SkPicture> srcPic(src.endRecording());
113 113
114 // A target canvas with an empty clip. 114 // A target canvas with an empty clip.
115 SkCanvas* c = dst.beginRecording(1,1, NULL); 115 SkCanvas* c = dst.beginRecording(1,1, NULL);
116 c->clipRect(SkRect::MakeEmpty()); 116 c->clipRect(SkRect::MakeEmpty());
117 srcPic->playback(c); 117 srcPic->playback(c);
118 SkAutoTUnref<SkPicture> dstPic(dst.endRecording()); 118 SkAutoTUnref<SkPicture> dstPic(dst.endRecording());
119 119
120 // Should be Clip - Save - Clear - Restore. 120 // Should be Clip - Save - Clear - Restore.
121 // Buggy implementations might return 1 (just Clip) or 3 (Clip - Save - Rest ore). 121 // Buggy implementations might return 1 (just Clip) or 3 (Clip - Save - Rest ore).
122 REPORTER_ASSERT(r, dstPic->approximateOpCount() == 4); 122 // TODO: can we just search that it contains "clear"? <reed>
123 REPORTER_ASSERT(r, dstPic->approximateOpCount() == 4 || dstPic->approximateO pCount() == 2);
123 } 124 }
124 125
125 DEF_TEST(PictureBBH_Clear, r) { 126 DEF_TEST(PictureBBH_Clear, r) {
126 test_clear(r, NULL); 127 test_clear(r, NULL);
127 128
128 SkTileGridFactory::TileGridInfo grid = { {1,1}, {0,0}, {0,0} }; 129 SkTileGridFactory::TileGridInfo grid = { {1,1}, {0,0}, {0,0} };
129 SkTileGridFactory tilegrid(grid); 130 SkTileGridFactory tilegrid(grid);
130 test_clear(r, &tilegrid); 131 test_clear(r, &tilegrid);
131 132
132 SkRTreeFactory rtree; 133 SkRTreeFactory rtree;
133 test_clear(r, &rtree); 134 test_clear(r, &rtree);
134 } 135 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698