| 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 struct TestBBH : public SkBBoxHierarchy { | 102 struct TestBBH : public SkBBoxHierarchy { |
| 103 virtual void insert(SkAutoTMalloc<SkRect>* boundsArray, int N) SK_OVERRIDE { | 103 virtual void insert(SkAutoTMalloc<SkRect>* boundsArray, int N) SK_OVERRIDE { |
| 104 fEntries.setCount(N); | 104 fEntries.setCount(N); |
| 105 for (int i = 0; i < N; i++) { | 105 for (int i = 0; i < N; i++) { |
| 106 Entry e = { (unsigned)i, (*boundsArray)[i] }; | 106 Entry e = { (unsigned)i, (*boundsArray)[i] }; |
| 107 fEntries[i] = e; | 107 fEntries[i] = e; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 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 {} |
| 112 virtual size_t bytesUsed() const SK_OVERRIDE { return 0; } |
| 112 | 113 |
| 113 struct Entry { | 114 struct Entry { |
| 114 unsigned opIndex; | 115 unsigned opIndex; |
| 115 SkRect bounds; | 116 SkRect bounds; |
| 116 }; | 117 }; |
| 117 SkTDArray<Entry> fEntries; | 118 SkTDArray<Entry> fEntries; |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 // Like a==b, with a little slop recognizing that float equality can be weird. | 121 // Like a==b, with a little slop recognizing that float equality can be weird. |
| 121 static bool sloppy_rect_eq(SkRect a, SkRect b) { | 122 static bool sloppy_rect_eq(SkRect a, SkRect b) { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 327 |
| 327 { | 328 { |
| 328 SkRecord record; | 329 SkRecord record; |
| 329 SkRecorder recorder(&record, 10, 10); | 330 SkRecorder recorder(&record, 10, 10); |
| 330 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); | 331 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); |
| 331 SkRecordDraw(record, &canvas, 0, 0); | 332 SkRecordDraw(record, &canvas, 0, 0); |
| 332 } | 333 } |
| 333 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); | 334 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); |
| 334 | 335 |
| 335 } | 336 } |
| OLD | NEW |