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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 639933003: Add SkBBoxHierarchy::reserve() as an optional size hint. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « tests/PictureTest.cpp ('k') | no next file » | 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 "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 expected.postConcat(translate); 96 expected.postConcat(translate);
97 REPORTER_ASSERT(r, setMatrix->matrix == expected); 97 REPORTER_ASSERT(r, setMatrix->matrix == expected);
98 } 98 }
99 99
100 struct TestBBH : public SkBBoxHierarchy { 100 struct TestBBH : public SkBBoxHierarchy {
101 virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_O VERRIDE { 101 virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_O VERRIDE {
102 Entry e = { opIndex, bounds }; 102 Entry e = { opIndex, bounds };
103 fEntries.push(e); 103 fEntries.push(e);
104 } 104 }
105 105
106 virtual void flushDeferredInserts() SK_OVERRIDE {}
107 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {} 106 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {}
108 107
109 struct Entry { 108 struct Entry {
110 unsigned opIndex; 109 unsigned opIndex;
111 SkRect bounds; 110 SkRect bounds;
112 }; 111 };
113 SkTDArray<Entry> fEntries; 112 SkTDArray<Entry> fEntries;
114 }; 113 };
115 114
116 // Like a==b, with a little slop recognizing that float equality can be weird. 115 // Like a==b, with a little slop recognizing that float equality can be weird.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // The second bug showed up as adjusting the picture bounds (0,0,50,50) by t he drop shadow too. 245 // The second bug showed up as adjusting the picture bounds (0,0,50,50) by t he drop shadow too.
247 // The saveLayer, clipRect, and restore bounds were incorrectly (0,0,70,50). 246 // The saveLayer, clipRect, and restore bounds were incorrectly (0,0,70,50).
248 TestBBH bbh; 247 TestBBH bbh;
249 SkRecordFillBounds(record, &bbh); 248 SkRecordFillBounds(record, &bbh);
250 REPORTER_ASSERT(r, bbh.fEntries.count() == 4); 249 REPORTER_ASSERT(r, bbh.fEntries.count() == 4);
251 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(0 , 0, 50, 50))); 250 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(0 , 0, 50, 50)));
252 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(0 , 0, 50, 50))); 251 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(0 , 0, 50, 50)));
253 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[2].bounds, SkRect::MakeLTRB(0 , 0, 40, 40))); 252 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[2].bounds, SkRect::MakeLTRB(0 , 0, 40, 40)));
254 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[3].bounds, SkRect::MakeLTRB(0 , 0, 50, 50))); 253 REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[3].bounds, SkRect::MakeLTRB(0 , 0, 50, 50)));
255 } 254 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698