• Home
  • Raw
  • Download

Lines Matching full:stack

57     // Build up a clip stack with a path, an empty clip, and a rect.  in test_assign_and_comparison()
148 static void assert_count(skiatest::Reporter* reporter, const SkClipStack& stack, in assert_count() argument
150 SkClipStack::B2TIter iter(stack); in assert_count()
161 SkClipStack stack; in test_iterators() local
172 stack.clipRect(gRects[i], SkMatrix::I(), kUnion_SkClipOp, false); in test_iterators()
175 assert_count(reporter, stack, 4); in test_iterators()
181 SkClipStack::B2TIter iter(stack); in test_iterators()
197 SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); in test_iterators()
213 SkClipStack::Iter iter(stack, SkClipStack::Iter::kBottom_IterStart); in test_iterators()
278 SkClipStack stack; in test_bounds() local
287 stack.save(); in test_bounds()
302 stack.clipRect(rectA, SkMatrix::I(), kIntersect_SkClipOp, false); in test_bounds()
303 stack.clipRect(rectB, SkMatrix::I(), gOps[op], false); in test_bounds()
306 stack.clipRRect(rrectA, SkMatrix::I(), kIntersect_SkClipOp, false); in test_bounds()
307 stack.clipRRect(rrectB, SkMatrix::I(), gOps[op], false); in test_bounds()
310 stack.clipPath(pathA, SkMatrix::I(), kIntersect_SkClipOp, false); in test_bounds()
311 stack.clipPath(pathB, SkMatrix::I(), gOps[op], false); in test_bounds()
315 REPORTER_ASSERT(reporter, !stack.isWideOpen()); in test_bounds()
316 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID()); in test_bounds()
318 stack.getConservativeBounds(0, 0, 100, 100, &devClipBound, in test_bounds()
332 stack.restore(); in test_bounds()
340 // Empty stack is wide open. Wide open stack means that gen id is wide open. in test_isWideOpen()
341 SkClipStack stack; in test_isWideOpen() local
342 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
343 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
351 // Stack should initially be wide open in test_isWideOpen()
353 SkClipStack stack; in test_isWideOpen() local
355 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
356 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
361 SkClipStack stack; in test_isWideOpen() local
371 stack.clipPath(clipA, SkMatrix::I(), kReplace_SkClipOp, false); in test_isWideOpen()
372 stack.clipPath(clipB, SkMatrix::I(), kUnion_SkClipOp, false); in test_isWideOpen()
374 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
375 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
380 SkClipStack stack; in test_isWideOpen() local
382 stack.clipRect(rectA, SkMatrix::I(), kUnion_SkClipOp, false); in test_isWideOpen()
384 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
385 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
390 SkClipStack stack; in test_isWideOpen() local
395 stack.clipRect(emptyRect, SkMatrix::I(), kDifference_SkClipOp, false); in test_isWideOpen()
397 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
398 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
403 SkClipStack stack; in test_isWideOpen() local
405 stack.save(); in test_isWideOpen()
407 stack.clipRect(rectA, SkMatrix::I(), kReplace_SkClipOp, false); in test_isWideOpen()
409 REPORTER_ASSERT(reporter, !stack.isWideOpen()); in test_isWideOpen()
410 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID != stack.getTopmostGenID()); in test_isWideOpen()
412 stack.restore(); in test_isWideOpen()
414 REPORTER_ASSERT(reporter, stack.isWideOpen()); in test_isWideOpen()
415 REPORTER_ASSERT(reporter, SkClipStack::kWideOpenGenID == stack.getTopmostGenID()); in test_isWideOpen()
419 static int count(const SkClipStack& stack) { in count() argument
421 SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); in count()
439 SkClipStack stack; in test_rect_inverse_fill() local
440 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_inverse_fill()
444 stack.getBounds(&bounds, &boundsType); in test_rect_inverse_fill()
458 // the stack depth. BW replacing BW. in test_rect_replace()
460 SkClipStack stack; in test_rect_replace() local
461 REPORTER_ASSERT(reporter, 0 == count(stack)); in test_rect_replace()
462 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
463 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
464 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
465 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
469 // the stack depth. AA replacing AA. in test_rect_replace()
471 SkClipStack stack; in test_rect_replace() local
472 REPORTER_ASSERT(reporter, 0 == count(stack)); in test_rect_replace()
473 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_replace()
474 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
475 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_replace()
476 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
480 // the stack depth. BW replacing AA replacing BW. in test_rect_replace()
482 SkClipStack stack; in test_rect_replace() local
483 REPORTER_ASSERT(reporter, 0 == count(stack)); in test_rect_replace()
484 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
485 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
486 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_replace()
487 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
488 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
489 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
494 SkClipStack stack; in test_rect_replace() local
495 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
496 stack.clipRect(rect2, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_replace()
497 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
499 stack.save(); in test_rect_replace()
500 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
501 REPORTER_ASSERT(reporter, 2 == count(stack)); in test_rect_replace()
502 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_replace()
504 stack.restore(); in test_rect_replace()
505 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
507 stack.save(); in test_rect_replace()
508 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
509 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
510 REPORTER_ASSERT(reporter, 2 == count(stack)); in test_rect_replace()
511 stack.restore(); in test_rect_replace()
512 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
514 stack.save(); in test_rect_replace()
515 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
516 stack.clipRect(rect2, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_replace()
517 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_replace()
518 REPORTER_ASSERT(reporter, 2 == count(stack)); in test_rect_replace()
519 stack.restore(); in test_rect_replace()
520 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_replace()
530 // Replace operation doesn't grow the stack. in test_path_replace()
532 SkClipStack stack; in test_path_replace() local
533 REPORTER_ASSERT(reporter, 0 == count(stack)); in test_path_replace()
534 stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, false); in test_path_replace()
535 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_path_replace()
536 stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, false); in test_path_replace()
537 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_path_replace()
542 SkClipStack stack; in test_path_replace() local
543 stack.clipRect(rect, SkMatrix::I(), kReplace_SkClipOp, true); in test_path_replace()
544 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_path_replace()
545 stack.clipPath(path, SkMatrix::I(), kReplace_SkClipOp, true); in test_path_replace()
546 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_path_replace()
566 SkClipStack stack; in test_rect_merging() local
568 stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_merging()
570 stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_merging()
572 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_merging()
574 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
581 SkClipStack stack; in test_rect_merging() local
583 stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_merging()
585 stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, true); in test_rect_merging()
587 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_merging()
589 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
596 SkClipStack stack; in test_rect_merging() local
598 stack.clipRect(overlapLeft, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_merging()
600 stack.clipRect(overlapRight, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_merging()
602 REPORTER_ASSERT(reporter, 2 == count(stack)); in test_rect_merging()
604 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
611 SkClipStack stack; in test_rect_merging() local
613 stack.clipRect(nestedParent, SkMatrix::I(), kReplace_SkClipOp, true); in test_rect_merging()
615 stack.clipRect(nestedChild, SkMatrix::I(), kIntersect_SkClipOp, false); in test_rect_merging()
617 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_merging()
619 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
626 SkClipStack stack; in test_rect_merging() local
628 stack.clipRect(nestedParent, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_merging()
630 stack.clipRect(nestedChild, SkMatrix::I(), kIntersect_SkClipOp, true); in test_rect_merging()
632 REPORTER_ASSERT(reporter, 1 == count(stack)); in test_rect_merging()
634 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
641 SkClipStack stack; in test_rect_merging() local
643 stack.clipRect(nestedChild, SkMatrix::I(), kReplace_SkClipOp, false); in test_rect_merging()
645 stack.clipRect(nestedParent, SkMatrix::I(), kIntersect_SkClipOp, true); in test_rect_merging()
647 REPORTER_ASSERT(reporter, 2 == count(stack)); in test_rect_merging()
649 stack.getBounds(&bound, &type, &isIntersectionOfRects); in test_rect_merging()
672 SkClipStack stack; in test_quickContains() local
673 stack.clipRect(outsideRect, SkMatrix::I(), kDifference_SkClipOp, false); in test_quickContains()
675 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
680 SkClipStack stack; in test_quickContains() local
681 stack.clipRect(outsideRect, SkMatrix::I(), kReplace_SkClipOp, false); in test_quickContains()
682 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
686 SkClipStack stack; in test_quickContains() local
687 stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
688 stack.save(); // To prevent in-place substitution by replace OP in test_quickContains()
689 stack.clipRect(outsideRect, SkMatrix::I(), kReplace_SkClipOp, false); in test_quickContains()
690 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
691 stack.restore(); in test_quickContains()
695 SkClipStack stack; in test_quickContains() local
696 stack.clipRect(outsideRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
697 stack.save(); // To prevent in-place substitution by replace OP in test_quickContains()
698 stack.clipRect(insideRect, SkMatrix::I(), kReplace_SkClipOp, false); in test_quickContains()
699 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
700 stack.restore(); in test_quickContains()
705 SkClipStack stack; in test_quickContains() local
706 stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
708 stack.clipPath(outsideCircle, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
709 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
714 SkClipStack stack; in test_quickContains() local
715 stack.clipRect(outsideRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
716 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
720 SkClipStack stack; in test_quickContains() local
721 stack.clipRect(insideRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
722 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
726 SkClipStack stack; in test_quickContains() local
727 stack.clipRect(intersectingRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
728 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
732 SkClipStack stack; in test_quickContains() local
733 stack.clipRect(nonIntersectingRect, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
734 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
739 SkClipStack stack; in test_quickContains() local
740 stack.clipPath(outsideCircle, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
741 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
745 SkClipStack stack; in test_quickContains() local
746 stack.clipPath(insideCircle, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
747 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
751 SkClipStack stack; in test_quickContains() local
752 stack.clipPath(intersectingCircle, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
753 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
757 SkClipStack stack; in test_quickContains() local
758 stack.clipPath(nonIntersectingCircle, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
759 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
764 SkClipStack stack; in test_quickContains() local
768 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
769 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
773 SkClipStack stack; in test_quickContains() local
777 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
778 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
782 SkClipStack stack; in test_quickContains() local
786 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
787 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
791 SkClipStack stack; in test_quickContains() local
795 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
796 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
801 SkClipStack stack; in test_quickContains() local
804 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
805 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
809 SkClipStack stack; in test_quickContains() local
812 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
813 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
817 SkClipStack stack; in test_quickContains() local
820 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
821 REPORTER_ASSERT(reporter, false == stack.quickContains(testRect)); in test_quickContains()
825 SkClipStack stack; in test_quickContains() local
828 stack.clipPath(path, SkMatrix::I(), kIntersect_SkClipOp, false); in test_quickContains()
829 REPORTER_ASSERT(reporter, true == stack.quickContains(testRect)); in test_quickContains()
833 static void set_region_to_stack(const SkClipStack& stack, const SkIRect& bounds, SkRegion* region) { in set_region_to_stack() argument
835 SkClipStack::Iter iter(stack, SkClipStack::Iter::kBottom_IterStart); in set_region_to_stack()
856 SkClipStack stack; in test_invfill_diff_bug() local
857 stack.clipRect({10, 10, 20, 20}, SkMatrix::I(), kIntersect_SkClipOp, false); in test_invfill_diff_bug()
862 stack.clipPath(path, SkMatrix::I(), kDifference_SkClipOp, false); in test_invfill_diff_bug()
864 REPORTER_ASSERT(reporter, SkClipStack::kEmptyGenID == stack.getTopmostGenID()); in test_invfill_diff_bug()
868 stack.getBounds(&stackBounds, &stackBoundsType); in test_invfill_diff_bug()
874 set_region_to_stack(stack, {0, 0, 50, 30}, &region); in test_invfill_diff_bug()
881 // Functions that add a shape to the clip stack. The shape is computed from a rectangle.
882 // AA is always disabled since the clip stack reducer can cause changes in aa rasterization of the
883 // stack. A fractional edge repeated in different elements may be rasterized fewer times using the
884 // reduced stack.
888 SkClipStack* stack,
891 static void add_round_rect(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack, in add_round_rect() argument
899 stack->clipPath(path, SkMatrix::I(), op, doAA); in add_round_rect()
903 stack->clipRRect(rrect, SkMatrix::I(), op, doAA); in add_round_rect()
907 static void add_rect(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack, in add_rect() argument
913 stack->clipPath(path, SkMatrix::I(), op, doAA); in add_rect()
915 stack->clipRect(rect, SkMatrix::I(), op, doAA); in add_rect()
919 static void add_oval(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack, in add_oval() argument
926 stack->clipPath(path, SkMatrix::I(), op, doAA); in add_oval()
929 static void add_shader(const SkRect& rect, bool invert, SkClipOp op, SkClipStack* stack, in add_shader() argument
932 // in the SkCanvas->SkDevice stack. Use rect to produce unique gradients, however. in add_shader()
936 stack->clipShader(std::move(gradient)); in add_shader()
939 static void add_elem_to_stack(const SkClipStack::Element& element, SkClipStack* stack) { in add_elem_to_stack() argument
942 stack->clipRect(element.getDeviceSpaceRect(), SkMatrix::I(), element.getOp(), in add_elem_to_stack()
946 stack->clipRRect(element.getDeviceSpaceRRect(), SkMatrix::I(), element.getOp(), in add_elem_to_stack()
950 stack->clipPath(element.getDeviceSpacePath(), SkMatrix::I(), element.getOp(), in add_elem_to_stack()
955 stack->clipShader(element.refShader()); in add_elem_to_stack()
959 stack->clipEmpty(); in add_elem_to_stack()
1014 // Randomly generate a clip stack. in test_reduced_clip_stack()
1015 SkClipStack stack; in test_reduced_clip_stack() local
1029 // saves can change the clip stack behavior when an element is added. in test_reduced_clip_stack()
1060 kElementFuncs[r.nextULessThan(functionLimit)](rect, invert, op, &stack, doAA); in test_reduced_clip_stack()
1062 stack.save(); in test_reduced_clip_stack()
1075 // Get the reduced version of the stack. in test_reduced_clip_stack()
1078 const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, queryBounds, caps); in test_reduced_clip_stack()
1089 stack.getBounds(&stackBounds, &stackBoundsType); in test_reduced_clip_stack()
1093 // Build a new clip stack based on the reduced clip elements in test_reduced_clip_stack()
1111 stack.clipDevRect(scissor, kIntersect_SkClipOp); in test_reduced_clip_stack()
1113 // convert both the original stack and reduced stack to SkRegions and see if they're equal in test_reduced_clip_stack()
1115 set_region_to_stack(stack, scissor, &region); in test_reduced_clip_stack()
1134 SkClipStack stack; in test_reduced_clip_stack_genid() local
1135 stack.clipRect(SkRect::MakeXYWH(0, 0, 100, 100), SkMatrix::I(), kReplace_SkClipOp, in test_reduced_clip_stack_genid()
1137 stack.clipRect(SkRect::MakeXYWH(0, 0, SkScalar(50.3), SkScalar(50.3)), SkMatrix::I(), in test_reduced_clip_stack_genid()
1147 const GrReducedClip* reduced = new (storage.get()) GrReducedClip(stack, bounds, caps); in test_reduced_clip_stack_genid()
1156 SkClipStack stack; in test_reduced_clip_stack_genid() local
1162 stack.clipRect(SkRect::MakeXYWH(0, 0, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(), in test_reduced_clip_stack_genid()
1164 uint32_t genIDA = stack.getTopmostGenID(); in test_reduced_clip_stack_genid()
1165 stack.clipRect(SkRect::MakeXYWH(50, 0, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(), in test_reduced_clip_stack_genid()
1167 uint32_t genIDB = stack.getTopmostGenID(); in test_reduced_clip_stack_genid()
1168 stack.clipRect(SkRect::MakeXYWH(0, 50, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(), in test_reduced_clip_stack_genid()
1170 uint32_t genIDC = stack.getTopmostGenID(); in test_reduced_clip_stack_genid()
1171 stack.clipRect(SkRect::MakeXYWH(50, 50, SkScalar(25.3), SkScalar(25.3)), SkMatrix::I(), in test_reduced_clip_stack_genid()
1173 uint32_t genIDD = stack.getTopmostGenID(); in test_reduced_clip_stack_genid()
1234 const GrReducedClip reduced(stack, testCases[i].testBounds, caps); in test_reduced_clip_stack_genid()
1252 SkClipStack stack; in test_reduced_clip_stack_no_aa_crash() local
1253 stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 100, 100), kReplace_SkClipOp); in test_reduced_clip_stack_no_aa_crash()
1254 stack.clipDevRect(SkIRect::MakeXYWH(0, 0, 50, 50), kReplace_SkClipOp); in test_reduced_clip_stack_no_aa_crash()
1261 const GrReducedClip reduced(stack, bounds, caps); in test_reduced_clip_stack_no_aa_crash()
1273 const SkClipStack& stack, const SkMatrix& queryXform, in test_aa_query() argument
1281 const GrReducedClip reduced(stack, queryBounds, caps); in test_aa_query()
1285 stack.getBounds(&stackBounds, &stackBoundsType); in test_aa_query()
1358 SkClipStack stack; in test_reduced_clip_stack_aa() local
1359 stack.clipRect(alignedRect, SkMatrix::I(), kIntersect_SkClipOp, true); in test_reduced_clip_stack_aa()
1360 test_aa_query(reporter, name, stack, m, {IL, IT, IR, IB}, ClipMethod::kIgnoreClip); in test_reduced_clip_stack_aa()
1361 test_aa_query(reporter, name, stack, m, {IL, IT-1, IR, IT}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1362 test_aa_query(reporter, name, stack, m, {IL, IT-2, IR, IB}, ClipMethod::kScissor); in test_reduced_clip_stack_aa()
1366 stack.reset(); in test_reduced_clip_stack_aa()
1367 stack.clipRect(rect, SkMatrix::I(), kIntersect_SkClipOp, true); in test_reduced_clip_stack_aa()
1368 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kIgnoreClip); in test_reduced_clip_stack_aa()
1369 test_aa_query(reporter, name, stack, m, {L-.1f, T, L, B}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1370 test_aa_query(reporter, name, stack, m, {L-.1f, T, L+.1f, B}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1374 stack.reset(); in test_reduced_clip_stack_aa()
1375 stack.clipRect(rect, SkMatrix::I(), kDifference_SkClipOp, true); in test_reduced_clip_stack_aa()
1376 test_aa_query(reporter, name, stack, m, {L, T, R, B}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1377 test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T}, ClipMethod::kIgnoreClip); in test_reduced_clip_stack_aa()
1378 test_aa_query(reporter, name, stack, m, {L, T-.1f, R, T+.1f}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1382 stack.reset(); in test_reduced_clip_stack_aa()
1383 stack.clipRect(rect, SkMatrix::I(), kIntersect_SkClipOp, true); in test_reduced_clip_stack_aa()
1384 stack.clipRect(innerRect, SkMatrix::I(), kXOR_SkClipOp, true); in test_reduced_clip_stack_aa()
1385 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1386 test_aa_query(reporter, name, stack, m, {r-.1f, t, R, b}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1387 test_aa_query(reporter, name, stack, m, {r-.1f, t, R+.1f, b}, ClipMethod::kAAElements, 2); in test_reduced_clip_stack_aa()
1388 test_aa_query(reporter, name, stack, m, {r, t, R+.1f, b}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1389 test_aa_query(reporter, name, stack, m, {r, t, R, b}, ClipMethod::kIgnoreClip); in test_reduced_clip_stack_aa()
1390 test_aa_query(reporter, name, stack, m, {R, T, R+.1f, B}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1394 stack.reset(); in test_reduced_clip_stack_aa()
1395 stack.clipRect(alignedRect, SkMatrix::I(), kIntersect_SkClipOp, true); in test_reduced_clip_stack_aa()
1396 stack.clipRect(innerRect, SkMatrix::I(), kXOR_SkClipOp, true); in test_reduced_clip_stack_aa()
1397 test_aa_query(reporter, name, stack, m, {l, t, r, b}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1398 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1399 test_aa_query(reporter, name, stack, m, {l, b-.1f, r, IB+.1f}, ClipMethod::kAAElements, 1); in test_reduced_clip_stack_aa()
1400 test_aa_query(reporter, name, stack, m, {l, b, r, IB+.1f}, ClipMethod::kAAElements, 0); in test_reduced_clip_stack_aa()
1401 test_aa_query(reporter, name, stack, m, {l, b, r, IB}, ClipMethod::kIgnoreClip); in test_reduced_clip_stack_aa()
1402 test_aa_query(reporter, name, stack, m, {IL, IB, IR, IB+.1f}, ClipMethod::kSkipDraw); in test_reduced_clip_stack_aa()
1404 // Apply random transforms and try again. This ensures the clip stack reduction is hardened in test_reduced_clip_stack_aa()
1441 for (const SkClipStack& stack : {rectStack, pathStack}) { in test_tiny_query_bounds_assertion_bug()
1446 const GrReducedClip reduced(stack, queryBounds, caps); in test_tiny_query_bounds_assertion_bug()
1459 SkClipStack stack; in test_is_rrect_deep_rect_stack() local
1461 stack.save(); in test_is_rrect_deep_rect_stack()
1462 stack.clipRect(SkRect::MakeLTRB(i, 0.5, kTargetBounds.width(), kTargetBounds.height()), in test_is_rrect_deep_rect_stack()
1469 if (stack.isRRect(kTargetBounds, &rrect, &isAA)) { in test_is_rrect_deep_rect_stack()
1477 SkClipStack stack; in test_is_rrect_deep_rect_stack() local
1481 stack.save(); in test_is_rrect_deep_rect_stack()
1482 stack.clipRect(SkRect::MakeLTRB(i, j + 0.5, kTargetBounds.width(), kTargetBounds.height()), in test_is_rrect_deep_rect_stack()
1487 REPORTER_ASSERT(reporter, !stack.isRRect(kTargetBounds, &rrect, &isAA)); in test_is_rrect_deep_rect_stack()
1491 SkClipStack stack; in DEF_TEST() local
1493 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount()); in DEF_TEST()
1494 assert_count(reporter, stack, 0); in DEF_TEST()
1503 stack.clipDevRect(gRects[i], kIntersect_SkClipOp); in DEF_TEST()
1507 SkClipStack::B2TIter iter(stack); in DEF_TEST()
1520 stack.reset(); in DEF_TEST()
1521 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount()); in DEF_TEST()
1522 assert_count(reporter, stack, 0); in DEF_TEST()
1564 SkClipStack stack; in DEF_GPUTEST_FOR_ALL_CONTEXTS() local
1581 stack.save(); in DEF_GPUTEST_FOR_ALL_CONTEXTS()
1582 stack.clipPath(path, m, SkClipOp::kIntersect, true); in DEF_GPUTEST_FOR_ALL_CONTEXTS()
1584 GrClipStackClip(stackBounds.size(), &stack).testingOnly_createClipMask(context); in DEF_GPUTEST_FOR_ALL_CONTEXTS()
1595 stack.restore(); in DEF_GPUTEST_FOR_ALL_CONTEXTS()