Home | History | Annotate | Download | only in gpu

Lines Matching refs:element

150     // We use a slightly relaxed set of query bounds for element containment tests. This is to
161 const Element* element = iter.prev();
162 if (nullptr == element) {
166 if (SkClipStack::kEmptyGenID == element->getGenID()) {
170 if (SkClipStack::kWideOpenGenID == element->getGenID()) {
178 switch (element->getOp()) {
182 if (element->isInverseFilled()) {
183 if (element->contains(relaxedQueryBounds)) {
185 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
189 ClipResult result = this->clipInsideElement(element);
196 if (element->contains(relaxedQueryBounds)) {
199 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
202 ClipResult result = this->clipOutsideElement(element);
217 if (element->isInverseFilled()) {
218 if (element->contains(relaxedQueryBounds)) {
221 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
224 ClipResult result = this->clipOutsideElement(element);
231 if (element->contains(relaxedQueryBounds)) {
233 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
237 ClipResult result = this->clipInsideElement(element);
249 // If the union-ed shape contains the entire bounds then after this element
252 if (element->isInverseFilled()) {
253 if (element->contains(relaxedQueryBounds)) {
255 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
260 if (element->contains(relaxedQueryBounds)) {
263 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
276 if (element->isInverseFilled()) {
277 if (element->contains(relaxedQueryBounds)) {
279 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
283 if (element->contains(relaxedQueryBounds)) {
285 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
296 // the bounds then we know after this element is applied that the bounds will be
298 if (element->isInverseFilled()) {
299 if (element->contains(relaxedQueryBounds)) {
302 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
306 if (element->contains(relaxedQueryBounds)) {
308 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
323 if (element->isInverseFilled()) {
324 if (element->contains(relaxedQueryBounds)) {
327 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
331 ClipResult result = this->clipOutsideElement(element);
341 if (element->contains(relaxedQueryBounds)) {
344 } else if (GrClip::IsOutsideClip(element->getBounds(), queryBounds)) {
348 ClipResult result = this->clipInsideElement(element);
369 // This will be the last element. Record the stricter genID.
370 fMaskGenID = element->getGenID();
375 SkASSERT(kXOR_SkClipOp == element->getOp() ||
376 kReverseDifference_SkClipOp == element->getOp());
380 Element* newElement = fMaskElements.addToHead(*element);
406 Element* element = fMaskElements.headIter().get();
407 while (element) {
409 switch (element->getOp()) {
419 // We can clear to zero and then simply draw the clip element.
421 element->setOp(kReplace_SkClipOp);
430 element->setOp(kReplace_SkClipOp);
436 element->setOp(kReplace_SkClipOp);
446 skippable = element->isInverseFilled() ?
447 GrClip::IsOutsideClip(element->getBounds(), queryBounds) :
448 element->contains(relaxedQueryBounds);
452 element->setOp(kReplace_SkClipOp);
467 if (element->isAA()) {
471 element = fMaskElements.headIter().get();
481 GrReducedClip::ClipResult GrReducedClip::clipInsideElement(const Element* element) {
483 if (!element->isAA()) {
484 element->getBounds().round(&elementIBounds);
486 elementIBounds = GrClip::GetPixelIBounds(element->getBounds());
494 switch (element->getDeviceSpaceType()) {
495 case Element::DeviceSpaceType::kEmpty:
498 case Element::DeviceSpaceType::kRect:
499 SkASSERT(element->getBounds() == element->getDeviceSpaceRect());
500 SkASSERT(!element->isInverseFilled());
501 if (element->isAA()) {
503 fAAClipRect = element->getDeviceSpaceRect();
506 // element's GenID. And since we walk the stack backwards, this means it's just
507 // the first element we don't skip during our walk.
508 fAAClipRectGenID = fMaskElements.isEmpty() ? element->getGenID() : fMaskGenID;
510 } else if (!fAAClipRect.intersect(element->getDeviceSpaceRect())) {
517 case Element::DeviceSpaceType::kRRect:
518 SkASSERT(!element->isInverseFilled());
519 return this->addAnalyticFP(element->getDeviceSpaceRRect(), Invert::kNo,
520 GrAA(element->isAA()));
522 case Element::DeviceSpaceType::kPath:
523 return this->addAnalyticFP(element->getDeviceSpacePath(),
524 Invert(element->isInverseFilled()), GrAA(element->isAA()));
531 GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* element) {
532 switch (element->getDeviceSpaceType()) {
533 case Element::DeviceSpaceType::kEmpty:
536 case Element::DeviceSpaceType::kRect:
537 SkASSERT(!element->isInverseFilled());
541 this->addWindowRectangle(element->getDeviceSpaceRect(), element->isAA());
542 if (!element->isAA()) {
546 return this->addAnalyticFP(element->getDeviceSpaceRect(), Invert::kYes,
547 GrAA(element->isAA()));
549 case Element::DeviceSpaceType::kRRect: {
550 SkASSERT(!element->isInverseFilled());
551 const SkRRect& clipRRect = element->getDeviceSpaceRRect();
553 GrAA(element->isAA()));
559 // "plus". This doesn't let us skip the clip element, but still saves processing time.
578 this->addWindowRectangle(horzRect, element->isAA());
583 this->addWindowRectangle(vertRect, element->isAA());
589 case Element::DeviceSpaceType::kPath:
590 return this->addAnalyticFP(element->getDeviceSpacePath(),
591 Invert(!element->isInverseFilled()), GrAA(element->isAA()));
687 const SkClipStack::Element* element) {
688 GrAA aa = GrAA(element->isAA());
689 switch (element->getDeviceSpaceType()) {
690 case SkClipStack::Element::DeviceSpaceType::kEmpty:
691 SkDEBUGFAIL("Should never get here with an empty element.");
693 case SkClipStack::Element::DeviceSpaceType::kRect:
694 return rtc->priv().drawAndStencilRect(clip, ss, (SkRegion::Op)element->getOp(),
695 element->isInverseFilled(), aa, viewMatrix,
696 element->getDeviceSpaceRect());
700 element->asDeviceSpacePath(&path);
705 return rtc->priv().drawAndStencilPath(clip, ss, (SkRegion::Op)element->getOp(),
706 element->isInverseFilled(), aa, viewMatrix, path);
719 const SkClipStack::Element* element) {
721 switch (element->getDeviceSpaceType()) {
722 case SkClipStack::Element::DeviceSpaceType::kEmpty:
723 SkDEBUGFAIL("Should never get here with an empty element.");
725 case SkClipStack::Element::DeviceSpaceType::kRect:
726 rtc->drawRect(clip, std::move(paint), aa, viewMatrix, element->getDeviceSpaceRect());
730 element->asDeviceSpacePath(&path);
761 // walk through each clip element and perform its set op
763 const Element* element = iter.get();
764 SkRegion::Op op = (SkRegion::Op)element->getOp();
765 GrAA aa = GrAA(element->isAA());
766 bool invert = element->isInverseFilled();
779 if (!stencil_element(rtc, clip, &kStencilInElement, translate, element)) {
802 draw_element(rtc, clip, std::move(paint), aa, translate, element);
825 // walk through each clip element and perform its set op with the existing clip.
827 const Element* element = iter.get();
829 if (element->isAA() && GrFSAAType::kNone != renderTargetContext->fsaaType()) {
839 SkRegion::Op op = (SkRegion::Op)element->getOp();
843 if (Element::DeviceSpaceType::kRect == element->getDeviceSpaceType()) {
847 element->asDeviceSpacePath(&clipPath);
873 bool drawDirectToClip; // Given the renderer, the element,
875 // we render the element directly to
881 // draw the element to the client stencil bits if necessary
892 if (Element::DeviceSpaceType::kRect == element->getDeviceSpaceType()) {
895 element->getDeviceSpaceRect());
930 // element directly or a bounding rect of the entire clip.
933 if (Element::DeviceSpaceType::kRect == element->getDeviceSpaceType()) {
936 element->getDeviceSpaceRect());