OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |