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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (useBBH) { | 105 if (useBBH) { |
106 SkRTreeFactory factory; | 106 SkRTreeFactory factory; |
107 bbh.reset((factory)(kWidth, kHeight)); | 107 bbh.reset((factory)(kWidth, kHeight)); |
108 SkRecordFillBounds(record, bbh); | 108 SkRecordFillBounds(record, bbh); |
109 } | 109 } |
110 | 110 |
111 SkRecord rerecord; | 111 SkRecord rerecord; |
112 SkRecorder canvas(&rerecord, kWidth, kHeight); | 112 SkRecorder canvas(&rerecord, kWidth, kHeight); |
113 GrRecordReplaceDraw(record, &canvas, bbh, &replacements, NULL/*callback*/); | 113 GrRecordReplaceDraw(record, &canvas, bbh, &replacements, NULL/*callback*/); |
114 | 114 |
115 REPORTER_ASSERT(r, 4 == rerecord.count()); | 115 REPORTER_ASSERT(r, 7 == rerecord.count()); |
116 assert_type<SkRecords::Save>(r, rerecord, 0); | 116 assert_type<SkRecords::Save>(r, rerecord, 0); |
117 assert_type<SkRecords::DrawBitmapRectToRect>(r, rerecord, 1); | 117 assert_type<SkRecords::Save>(r, rerecord, 1); |
118 assert_type<SkRecords::DrawRect>(r, rerecord, 2); | 118 assert_type<SkRecords::SetMatrix>(r, rerecord, 2); |
119 assert_type<SkRecords::Restore>(r, rerecord, 3); | 119 assert_type<SkRecords::DrawBitmapRectToRect>(r, rerecord, 3); |
| 120 assert_type<SkRecords::Restore>(r, rerecord, 4); |
| 121 assert_type<SkRecords::DrawRect>(r, rerecord, 5); |
| 122 assert_type<SkRecords::Restore>(r, rerecord, 6); |
120 } | 123 } |
121 | 124 |
122 DEF_TEST(RecordReplaceDraw_Replace, r) { test_replacements(r, false); } | 125 DEF_TEST(RecordReplaceDraw_Replace, r) { test_replacements(r, false); } |
123 DEF_TEST(RecordReplaceDraw_ReplaceWithBBH, r) { test_replacements(r, true); } | 126 DEF_TEST(RecordReplaceDraw_ReplaceWithBBH, r) { test_replacements(r, true); } |
124 | 127 |
125 #endif | 128 #endif |
OLD | NEW |