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

Side by Side Diff: tests/RecordReplaceDrawTest.cpp

Issue 551843002: Fix two SkRecord-backed layer hoisting bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit test Created 6 years, 3 months 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 | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | 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 #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
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
OLDNEW
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698