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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 670213002: Cut down SkBBH API more. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: virtual Created 6 years, 1 month 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/RTreeTest.cpp ('k') | tests/RecordReplaceDrawTest.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 "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 setMatrix = assert_type<SkRecords::SetMatrix>(r, translateRecord, 0); 93 setMatrix = assert_type<SkRecords::SetMatrix>(r, translateRecord, 0);
94 REPORTER_ASSERT(r, setMatrix->matrix == translate); 94 REPORTER_ASSERT(r, setMatrix->matrix == translate);
95 95
96 setMatrix = assert_type<SkRecords::SetMatrix>(r, translateRecord, 2); 96 setMatrix = assert_type<SkRecords::SetMatrix>(r, translateRecord, 2);
97 SkMatrix expected = scale; 97 SkMatrix expected = scale;
98 expected.postConcat(translate); 98 expected.postConcat(translate);
99 REPORTER_ASSERT(r, setMatrix->matrix == expected); 99 REPORTER_ASSERT(r, setMatrix->matrix == expected);
100 } 100 }
101 101
102 struct TestBBH : public SkBBoxHierarchy { 102 struct TestBBH : public SkBBoxHierarchy {
103 virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_O VERRIDE { 103 virtual void insert(SkAutoTMalloc<SkRect>* boundsArray, int N) SK_OVERRIDE {
104 Entry e = { opIndex, bounds }; 104 fEntries.setCount(N);
105 fEntries.push(e); 105 for (int i = 0; i < N; i++) {
106 Entry e = { (unsigned)i, (*boundsArray)[i] };
107 fEntries[i] = e;
108 }
106 } 109 }
107 110
108 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {} 111 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {}
109 112
110 struct Entry { 113 struct Entry {
111 unsigned opIndex; 114 unsigned opIndex;
112 SkRect bounds; 115 SkRect bounds;
113 }; 116 };
114 SkTDArray<Entry> fEntries; 117 SkTDArray<Entry> fEntries;
115 }; 118 };
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 305
303 { 306 {
304 SkRecord record; 307 SkRecord record;
305 SkRecorder recorder(&record, 10, 10); 308 SkRecorder recorder(&record, 10, 10);
306 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); 309 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10));
307 SkRecordDraw(record, &canvas, 0, 0); 310 SkRecordDraw(record, &canvas, 0, 0);
308 } 311 }
309 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); 312 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled);
310 313
311 } 314 }
OLDNEW
« no previous file with comments | « tests/RTreeTest.cpp ('k') | tests/RecordReplaceDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698