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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 entries.push(e); | 102 entries.push(e); |
103 } | 103 } |
104 virtual int getCount() const SK_OVERRIDE { return entries.count(); } | 104 virtual int getCount() const SK_OVERRIDE { return entries.count(); } |
105 | 105 |
106 virtual void flushDeferredInserts() SK_OVERRIDE {} | 106 virtual void flushDeferredInserts() SK_OVERRIDE {} |
107 | 107 |
108 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S
K_OVERRIDE {} | 108 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S
K_OVERRIDE {} |
109 virtual void clear() SK_OVERRIDE {} | 109 virtual void clear() SK_OVERRIDE {} |
110 virtual void rewindInserts() SK_OVERRIDE {} | 110 virtual void rewindInserts() SK_OVERRIDE {} |
111 virtual int getDepth() const SK_OVERRIDE { return -1; } | 111 virtual int getDepth() const SK_OVERRIDE { return -1; } |
| 112 virtual size_t bytesUsed() const SK_OVERRIDE { return 0; } |
112 | 113 |
113 struct Entry { | 114 struct Entry { |
114 uintptr_t data; | 115 uintptr_t data; |
115 SkIRect bounds; | 116 SkIRect bounds; |
116 }; | 117 }; |
117 SkTDArray<Entry> entries; | 118 SkTDArray<Entry> entries; |
118 }; | 119 }; |
119 | 120 |
120 // This test is not meant to make total sense yet. It's testing the status quo | 121 // This test is not meant to make total sense yet. It's testing the status quo |
121 // of SkRecordFillBounds(), which itself doesn't make total sense yet. | 122 // of SkRecordFillBounds(), which itself doesn't make total sense yet. |
(...skipping 11 matching lines...) Expand all Loading... |
133 | 134 |
134 SkRecordFillBounds(record, &bbh); | 135 SkRecordFillBounds(record, &bbh); |
135 | 136 |
136 REPORTER_ASSERT(r, bbh.entries.count() == 5); | 137 REPORTER_ASSERT(r, bbh.entries.count() == 5); |
137 for (int i = 0; i < bbh.entries.count(); i++) { | 138 for (int i = 0; i < bbh.entries.count(); i++) { |
138 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i); | 139 REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i); |
139 | 140 |
140 REPORTER_ASSERT(r, bbh.entries[i].bounds == SkIRect::MakeWH(400, 480)); | 141 REPORTER_ASSERT(r, bbh.entries[i].bounds == SkIRect::MakeWH(400, 480)); |
141 } | 142 } |
142 } | 143 } |
OLD | NEW |