Lines Matching refs:expected

16 // example skps and the compares the actual stored operations to the expected
29 // expected result information. Note: every saveLayer in a body method is
33 // combinations. They contribute to the expected result by outputting the
34 // expected matrix & clip ops. Note that, currently, the entire clip stack
142 DrawOpType draw, SkTDArray<DrawType>* expected,
146 SkTDArray<DrawType>* expected, int accumulatedClips);
149 SkTDArray<DrawType>* expected);
194 static void add_clip(ClipType clip, MatType mat, SkTDArray<DrawType>* expected) {
195 if (nullptr == expected) {
196 // expected is nullptr if this clip will be fused into later clips
204 *expected->append() = CONCAT;
205 *expected->append() = CLIP_RECT;
208 *expected->append() = CONCAT;
209 *expected->append() = CLIP_RRECT;
212 *expected->append() = CONCAT;
213 *expected->append() = CLIP_PATH;
216 *expected->append() = CONCAT;
217 *expected->append() = CLIP_REGION;
257 static void add_mat(MatType mat, SkTDArray<DrawType>* expected) {
258 if (nullptr == expected) {
259 // expected is nullptr if this matrix call will be fused into later ones
276 *expected->append() = CONCAT;
283 static void emit_draw(SkCanvas* canvas, DrawOpType draw, SkTDArray<DrawType>* expected) {
289 *expected->append() = DRAW_CLEAR;
295 *expected->append() = DRAW_OVAL;
302 *expected->append() = DRAW_RECT;
311 *expected->append() = DRAW_RRECT;
326 DrawOpType draw, SkTDArray<DrawType>* expected,
336 add_clip(clip, mat, expected);
338 add_mat(mat, expected);
347 DrawOpType draw, SkTDArray<DrawType>* expected,
358 add_clip(clip, mat, expected);
360 add_mat(mat, expected);
370 DrawOpType draw, SkTDArray<DrawType>* expected,
382 add_clip(clip, mat, expected);
383 add_clip(clip, mat, expected);
385 add_mat(mat, expected);
395 DrawOpType draw, SkTDArray<DrawType>* expected,
406 add_clip(clip, mat, expected);
407 add_clip(clip, mat, expected);
409 add_mat(mat, expected);
419 SkTDArray<DrawType>* expected, int accumulatedClips) {
424 *expected->append() = SAVE;
426 (*emitMC)(canvas, mat, clip, draw, expected, accumulatedClips+1);
427 emit_draw(canvas, draw, expected);
429 *expected->append() = RESTORE;
440 SkTDArray<DrawType>* expected, int accumulatedClips) {
445 *expected->append() = SAVE;
447 (*emitMC)(canvas, mat, clip, draw, expected, accumulatedClips+1);
448 emit_draw(canvas, draw, expected);
450 *expected->append() = RESTORE;
451 *expected->append() = SAVE;
453 (*emitMC)(canvas, mat, clip, draw, expected, accumulatedClips+2);
454 emit_draw(canvas, draw, expected);
456 *expected->append() = RESTORE;
468 SkTDArray<DrawType>* expected, int accumulatedClips) {
473 *expected->append() = SAVE;
475 (*emitMC)(canvas, mat, clip, kSaveLayer_DrawOpType, expected, accumulatedClips+1);
476 *expected->append() = SAVE_LAYER;
480 *expected->append() = SAVE;
482 (*emitMC)(canvas, mat, clip, draw, expected, 1);
483 emit_draw(canvas, draw, expected);
485 *expected->append() = RESTORE;
488 *expected->append() = RESTORE;
490 *expected->append() = RESTORE;
506 SkTDArray<DrawType>* expected, int accumulatedClips) {
511 *expected->append() = SAVE;
513 (*emitMC)(canvas, mat, clip, kSaveLayer_DrawOpType, expected, accumulatedClips+1);
514 *expected->append() = SAVE_LAYER;
517 (*emitMC)(canvas, mat, clip, kSaveLayer_DrawOpType, expected, 1);
519 *expected->append() = SAVE;
521 *expected->append() = SAVE_LAYER;
525 *expected->append() = SAVE;
527 (*emitMC)(canvas, mat, clip, draw, expected, 1);
528 emit_draw(canvas, draw, expected);
530 *expected->append() = RESTORE;
533 *expected->append() = RESTORE; // for saveLayer
535 *expected->append() = RESTORE;
539 *expected->append() = RESTORE;
541 *expected->append() = RESTORE;
555 SkTDArray<DrawType>* expected) {
556 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 0);
571 SkTDArray<DrawType>* expected) {
574 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 1);
594 SkTDArray<DrawType>* expected) {
597 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 1);
600 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 1);
623 SkTDArray<DrawType>* expected) {
626 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 1);
631 (*emitBody)(canvas, emitMC, mat, clip, draw, expected, 2);
640 static void print(const SkTDArray<DrawType>& expected, const SkTDArray<DrawType>& actual) {
641 SkDebugf("\n\nexpected %d --- actual %d\n", expected.count(), actual.count());
642 int max = std::max(expected.count(), actual.count());
645 if (i < expected.count()) {
646 SkDebugf("%16s, ", DrawCommand::GetCommandString(expected[i]));
683 SkTDArray<DrawType> expected, actual;
695 &expected);
700 REPORTER_ASSERT(reporter, expected.count() == actual.count());
702 if (expected.count() != actual.count()) {
704 print(expected, actual);
709 for (int i = 0; i < expected.count(); ++i) {
710 REPORTER_ASSERT(reporter, expected[i] == actual[i]);
712 if (expected[i] != actual[i]) {
713 print(expected, actual);