Lines Matching refs:element
20 SkClipStack::Element::Element(const Element& that) {
45 bool SkClipStack::Element::operator== (const Element& element) const {
46 if (this == &element) {
49 if (fOp != element.fOp ||
50 fType != element.fType ||
51 fDoAA != element.fDoAA ||
52 fSaveCount != element.fSaveCount) {
57 return this->getPath() == element.getPath();
59 return fRRect == element.fRRect;
61 return this->getRect() == element.getRect();
70 void SkClipStack::Element::replay(SkCanvasClipVisitor* visitor) const {
89 void SkClipStack::Element::invertShapeFillType() {
112 void SkClipStack::Element::initPath(int saveCount, const SkPath& path, SkRegion::Op op,
132 void SkClipStack::Element::asPath(SkPath* path) const {
151 void SkClipStack::Element::setEmpty() {
162 void SkClipStack::Element::checkEmpty() const {
170 bool SkClipStack::Element::canBeIntersectedInPlace(int saveCount, SkRegion::Op op) const {
182 bool SkClipStack::Element::rectRectIntersectAllowed(const SkRect& newR, bool newAA) const {
210 void SkClipStack::Element::combineBoundsDiff(FillCombo combination, const SkRect& prevFinite) {
247 SkDEBUGFAIL("SkClipStack::Element::combineBoundsDiff Invalid fill combination");
252 void SkClipStack::Element::combineBoundsXOR(int combination, const SkRect& prevFinite) {
279 SkDEBUGFAIL("SkClipStack::Element::combineBoundsXOR Invalid fill combination");
285 void SkClipStack::Element::combineBoundsUnion(int combination, const SkRect& prevFinite) {
309 SkDEBUGFAIL("SkClipStack::Element::combineBoundsUnion Invalid fill combination");
315 void SkClipStack::Element::combineBoundsIntersection(int combination, const SkRect& prevFinite) {
340 SkDEBUGFAIL("SkClipStack::Element::combineBoundsIntersection Invalid fill combination");
346 void SkClipStack::Element::combineBoundsRevDiff(int combination, const SkRect& prevFinite) {
375 SkDEBUGFAIL("SkClipStack::Element::combineBoundsRevDiff Invalid fill combination");
380 void SkClipStack::Element::updateBoundAndGenID(const Element* prior) {
385 // First, optimistically update the current Element's bound information
414 SkDEBUGFAIL("We shouldn't get here with an empty element.");
431 // Now determine the previous Element's bound information taking into
487 // This constant determines how many Element's are allocated together as a block in
494 : fDeque(sizeof(Element), kDefaultElementAllocCnt)
499 : fDeque(sizeof(Element), kDefaultElementAllocCnt) {
504 : fDeque(sizeof(Element), kDefaultElementAllocCnt)
512 : fDeque(sizeof(Element), kDefaultElementAllocCnt)
533 for (const Element* element = (const Element*)recIter.next();
534 element != NULL;
535 element = (const Element*)recIter.next()) {
536 new (fDeque.push_back()) Element(*element);
552 const Element* myElement = (const Element*)myIter.next();
553 const Element* bElement = (const Element*)bIter.next();
559 myElement = (const Element*)myIter.next();
560 bElement = (const Element*)bIter.next();
569 Element* element = (Element*)fDeque.back();
570 element->~Element();
588 Element* element = (Element*)fDeque.back();
589 if (element->fSaveCount <= saveCount) {
592 element->~Element();
602 Element* element = (Element*)fDeque.back();
604 if (NULL == element) {
614 *canvFiniteBound = element->fFiniteBound;
615 *boundType = element->fFiniteBoundType;
617 *isIntersectionOfRects = element->fIsIntersectionOfRects;
643 const Element* element = iter.prev();
644 while (element != NULL) {
645 if (SkRegion::kIntersect_Op != element->getOp() && SkRegion::kReplace_Op != element->getOp())
647 if (element->isInverseFilled()) {
648 // Part of 'rect' could be trimmed off by the inverse-filled clip element
649 if (SkRect::Intersects(element->getBounds(), rect)) {
653 if (!element->contains(rect)) {
657 if (SkRegion::kReplace_Op == element->getOp()) {
660 element = iter.prev();
665 void SkClipStack::pushElement(const Element& element) {
668 Element* prior = (Element*) iter.prev();
671 if (prior->canBeIntersectedInPlace(fSaveCount, element.getOp())) {
673 case Element::kEmpty_Type:
676 case Element::kRect_Type:
677 if (Element::kRect_Type == element.getType()) {
678 if (prior->rectRectIntersectAllowed(element.getRect(), element.isAA())) {
680 if (!isectRect.intersect(prior->getRect(), element.getRect())) {
686 prior->fDoAA = element.isAA();
687 Element* priorPrior = (Element*) iter.prev();
695 if (!SkRect::Intersects(prior->getBounds(), element.getBounds())) {
701 } else if (SkRegion::kReplace_Op == element.getOp()) {
703 prior = (Element*) fDeque.back();
706 Element* newElement = SkNEW_PLACEMENT_ARGS(fDeque.push_back(), Element, (element));
711 Element element(fSaveCount, rrect, op, doAA);
712 this->pushElement(element);
716 Element element(fSaveCount, rect, op, doAA);
717 this->pushElement(element);
721 Element element(fSaveCount, path, op, doAA);
722 this->pushElement(element);
726 Element* element = (Element*) fDeque.back();
728 if (element && element->canBeIntersectedInPlace(fSaveCount, SkRegion::kIntersect_Op)) {
729 element->setEmpty();
731 new (fDeque.push_back()) Element(fSaveCount);
733 ((Element*)fDeque.back())->fGenID = kEmptyGenID;
750 const SkClipStack::Element* SkClipStack::Iter::next() {
751 return (const SkClipStack::Element*)fIter.next();
754 const SkClipStack::Element* SkClipStack::Iter::prev() {
755 return (const SkClipStack::Element*)fIter.prev();
758 const SkClipStack::Element* SkClipStack::Iter::skipToTopmost(SkRegion::Op op) {
766 const SkClipStack::Element* element = NULL;
768 for (element = (const SkClipStack::Element*) fIter.prev();
769 NULL != element;
770 element = (const SkClipStack::Element*) fIter.prev()) {
772 if (op == element->fOp) {
774 // returned value. So while "element" is the element we want to
776 // return on the next "next" or "prev" call) the element
789 if (NULL == element) {
841 const Element* back = static_cast<const Element*>(fDeque.back());
850 void SkClipStack::Element::dump() const {
901 const Element* e;