Lines Matching defs:toAdd

895 bool ClipStack::SaveRecord::addElement(RawElement&& toAdd, RawElement::Stack* elements) {
898 SkASSERT((toAdd.shape().isEmpty() || !toAdd.outerBounds().isEmpty()) &&
899 (toAdd.innerBounds().isEmpty() || toAdd.outerBounds().contains(toAdd.innerBounds())));
906 } else if (toAdd.shape().isEmpty()) {
908 SkASSERT(toAdd.op() == SkClipOp::kIntersect);
915 switch (get_clip_geometry(*this, toAdd)) {
928 this->replaceWithElement(std::move(toAdd), elements);
941 this->replaceWithElement(std::move(toAdd), elements);
947 if (toAdd.op() == SkClipOp::kIntersect) {
948 // Intersect (stack) + Intersect (toAdd)
950 SkAssertResult(fOuterBounds.intersect(toAdd.outerBounds()));
951 if (!fInnerBounds.intersect(toAdd.innerBounds())) {
957 // Intersect (stack) + Difference (toAdd)
961 fOuterBounds = subtract(fOuterBounds, toAdd.innerBounds(), /* exact */ true);
962 fInnerBounds = subtract(fInnerBounds, toAdd.outerBounds(), /* exact */ false);
965 if (toAdd.op() == SkClipOp::kIntersect) {
966 // Difference (stack) + Intersect (toAdd)
967 // - Bounds updates are just the mirror of Intersect(stack) + Difference(toAdd)
969 fOuterBounds = subtract(toAdd.outerBounds(), fInnerBounds, /* exact */ true);
970 fInnerBounds = subtract(toAdd.innerBounds(), oldOuter, /* exact */ false);
972 // Difference (stack) + Difference (toAdd)
975 fOuterBounds.join(toAdd.outerBounds());
976 if (toAdd.innerBounds().width() * toAdd.innerBounds().height() >
978 fInnerBounds = toAdd.innerBounds();
989 return this->appendElement(std::move(toAdd), elements);
992 bool ClipStack::SaveRecord::appendElement(RawElement&& toAdd, RawElement::Stack* elements) {
1013 // We don't need to pass the actual index that toAdd will be saved to; just the minimum
1015 existing.updateForElement(&toAdd, *this);
1017 if (toAdd.isInvalid()) {
1056 fState = oldestValid == elements->count() ? toAdd.clipType() : ClipState::kComplex;
1057 if (fStackOp == SkClipOp::kDifference && toAdd.op() == SkClipOp::kIntersect) {
1064 // toAdd will be stored right after youngestValid
1073 *oldestActiveInvalid = std::move(toAdd);
1075 elements->push_back(std::move(toAdd));
1077 elements->back() = std::move(toAdd);
1085 void ClipStack::SaveRecord::replaceWithElement(RawElement&& toAdd, RawElement::Stack* elements) {
1087 fInnerBounds = toAdd.innerBounds();
1088 fOuterBounds = toAdd.outerBounds();
1089 fStackOp = toAdd.op();
1090 fState = toAdd.clipType();
1098 elements->push_back(std::move(toAdd));
1100 elements->back() = std::move(toAdd);