Lines Matching defs:elements

35 // This captures which of the two elements in (A op B) would be required when they are combined,
263 // coverage 1 (subsequent intersect elements will be inverse-filled and draw 0 outside).
309 const skgpu::v1::ClipStack::Element** elements,
331 // Since this will be rendered on another thread, make a copy of the elements in case
336 uploader->data().push_back(*(elements[i]));
364 draw_to_sw_mask(&helper,*(elements[i]), i == 0);
375 const skgpu::v1::ClipStack::Element** elements,
381 bool startInside = elements[0]->fOp == SkClipOp::kDifference;
384 const skgpu::v1::ClipStack::Element& e = *(elements[i]);
664 // This logic works under the assumption that both combined elements were intersect, so we
686 // Mark both elements as invalid to signal that the clip is fully empty
705 // 'added' now fully represents the combination of the two elements
762 // For the same save record, a larger mask will have the same or more elements
807 // The same goes for elements (the prior could have been wide open).
818 // if-cases. It may be kInvalid if the record hasn't had any elements added to it yet.
840 void ClipStack::SaveRecord::removeElements(RawElement::Stack* elements) {
841 while (elements->count() > fStartingElementIndex) {
842 elements->pop_back();
846 void ClipStack::SaveRecord::restoreElements(RawElement::Stack* elements) {
847 // Presumably this SaveRecord is the new top of the stack, and so it owns the elements
851 int i = elements->count() - 1;
852 for (RawElement& e : elements->ritems()) {
895 bool ClipStack::SaveRecord::addElement(RawElement&& toAdd, RawElement::Stack* elements) {
928 this->replaceWithElement(std::move(toAdd), elements);
941 this->replaceWithElement(std::move(toAdd), elements);
989 return this->appendElement(std::move(toAdd), elements);
992 bool ClipStack::SaveRecord::appendElement(RawElement&& toAdd, RawElement::Stack* elements) {
993 // Update past elements to account for the new element
994 int i = elements->count() - 1;
996 // After the loop, elements between [max(youngestValid, startingIndex)+1, count-1] can be
997 // removed from the stack (these are the active elements that have been invalidated by the
1000 // After the loop, elements between [0, oldestValid-1] are all invalid. The value of oldestValid
1002 int oldestValid = elements->count();
1007 int oldestActiveInvalidIndex = elements->count();
1009 for (RawElement& existing : elements->ritems()) {
1035 // Keep both new and old elements
1046 SkASSERT(oldestValid == elements->count() ||
1047 (oldestValid >= fOldestValidIndex && oldestValid < elements->count()));
1049 (youngestValid >= fStartingElementIndex && youngestValid < elements->count()));
1051 oldestActiveInvalidIndex < elements->count()) || !oldestActiveInvalid);
1056 fState = oldestValid == elements->count() ? toAdd.clipType() : ClipState::kComplex;
1058 // The stack remains in difference mode only as long as all elements are difference
1068 while (elements->count() > targetCount) {
1069 SkASSERT(oldestActiveInvalid != &elements->back()); // shouldn't delete what we'll reuse
1070 elements->pop_back();
1074 } else if (elements->count() < targetCount) {
1075 elements->push_back(std::move(toAdd));
1077 elements->back() = std::move(toAdd);
1085 void ClipStack::SaveRecord::replaceWithElement(RawElement&& toAdd, RawElement::Stack* elements) {
1094 while (elements->count() > targetCount) {
1095 elements->pop_back();
1097 if (elements->count() < targetCount) {
1098 elements->push_back(std::move(toAdd));
1100 elements->back() = std::move(toAdd);
1103 SkASSERT(elements->count() == fStartingElementIndex + 1);
1105 // This invalidates all older elements that are owned by save records lower in the clip stack.
1131 // Stack size determined empirically, the maximum number of elements put in a SW mask was 4
1172 // When we remove a save record, we delete all elements >= its starting index and any masks
1180 // Restore any remaining elements that were only invalidated by the now-removed save record.
1244 // The clip stack has complex shapes, multiple elements, or a shader; we could
1320 // The draw is combined with the saved clip elements; the below logic tries to skip
1321 // as many elements as possible.
1363 // All earlier elements have been invalidated by elements already processed
1371 // This can happen for difference op elements that have a larger fInnerBounds than
1411 // elements to remain scissor-only.
1467 // Now rasterize any remaining elements, either to the stencil or a SW mask. All elements are
1476 // Must use a texture mask to represent the combined clip elements since the stencil
1489 // Rasterize the remaining elements to the stencil buffer
1527 // Masks and geometry elements are not invalidated by updating the clip shader
1552 // since those are based on the net effect of all elements while device bounds clipping happens
1553 // implicitly. During addElement, we may still be able to invalidate some older elements).
1595 const Element** elements, int count,
1618 maskProxy = render_sw_mask(context, bounds, elements, count);