Lines Matching defs:quad

69 // Since the local quad may not be type kRect, this uses the opposites for each vertex when
153 // The quad's left edge may not align with the SkRect notion of left due to 90 degree rotations
154 // or mirrors. So, this processes the logical edges of the quad and clamps it to the 4 sides of
226 // to calculate the bounds of the quad.
227 static bool is_simple_rect(const GrQuad& quad) {
228 if (quad.quadType() != GrQuad::Type::kAxisAligned) {
234 return ((quad.x(0) + SK_ScalarNearlyZero) < quad.x(2)) &&
235 ((quad.y(0) + SK_ScalarNearlyZero) < quad.y(1));
359 void ResolveAAType(GrAAType requestedAAType, GrQuadAAFlags requestedEdgeFlags, const GrQuad& quad,
372 // For coverage AA, if the quad is a rect and it lines up with pixel boundaries
374 if (quad.quadType() == GrQuad::Type::kAxisAligned && !quad.aaHasEffectOnRect()) {
391 int ClipToW0(DrawQuad* quad, DrawQuad* extraVertices) {
394 SkASSERT(quad && extraVertices);
396 if (quad->fDevice.quadType() < GrQuad::Type::kPerspective) {
397 // W implicitly 1s for each vertex, so nothing to do but draw unmodified 'quad'
401 M4f validW = quad->fDevice.w4f() >= SkPathPriv::kW0PlaneDistance;
403 // Nothing to clip, can proceed normally drawing just 'quad'
411 GrQuad::Type localType = quad->fLocal.quadType();
417 // clipped we can define a new quad that covers the clipped shape directly. If there's 1 clipped
420 v.reset(quad->fDevice, &quad->fLocal);
446 // NOTE: when 3 vertices are clipped, this results in a degenerate quad where one vertex
467 // For 2 or 3 clipped vertices, the resulting shape is a quad or a triangle, so it can be
468 // entirely represented in 'quad'.
469 v.asGrQuads(&quad->fDevice, GrQuad::Type::kPerspective,
470 &quad->fLocal, localType);
484 // Make a quad formed by the 2 clipped points, the inserted mid point, and the good vertex
501 // The non-AA edge for this quad is the opposite of the clipped vertex's edge
506 extraVertices->fEdgeFlags = quad->fEdgeFlags & ~v2EdgeFlag;
508 // Make a quad formed by the remaining two good vertices, one clipped point, and the
523 // The non-AA edge for this quad is the clipped vertex's edge
529 v.asGrQuads(&quad->fDevice, GrQuad::Type::kPerspective,
530 &quad->fLocal, localType);
531 quad->fEdgeFlags &= ~v1EdgeFlag;
535 // Caller must draw both 'quad' and 'extraVertices' to cover the clipped geometry
540 bool CropToRect(const SkRect& cropRect, GrAA cropAA, DrawQuad* quad, bool computeLocal) {
541 SkASSERT(quad->fDevice.isFinite());
543 if (quad->fDevice.quadType() == GrQuad::Type::kAxisAligned) {
545 // of the crop and quad can be calculated exactly. Some care must be taken if the quad
549 if (is_simple_rect(quad->fDevice) && is_simple_rect(quad->fLocal)) {
550 clippedEdges = crop_simple_rect(cropRect, quad->fDevice.xs(), quad->fDevice.ys(),
551 quad->fLocal.xs(), quad->fLocal.ys());
553 clippedEdges = crop_rect(cropRect, quad->fDevice.xs(), quad->fDevice.ys(),
554 quad->fLocal.xs(), quad->fLocal.ys(), quad->fLocal.ws());
557 if (is_simple_rect(quad->fDevice)) {
558 clippedEdges = crop_simple_rect(cropRect, quad->fDevice.xs(), quad->fDevice.ys(),
561 clippedEdges = crop_rect(cropRect, quad->fDevice.xs(), quad->fDevice.ys(),
569 quad->fEdgeFlags |= clippedEdges;
572 quad->fEdgeFlags &= ~clippedEdges;
577 if (computeLocal || quad->fDevice.quadType() == GrQuad::Type::kPerspective) {
585 V4f devX = quad->fDevice.x4f();
586 V4f devY = quad->fDevice.y4f();
591 // Calculate barycentric coordinates for the 4 rect corners in the 2 triangles that the quad
603 // clipDevRect is completely inside this quad if each corner is in at least one of two triangles
608 // FIXME (michaelludwig) - there are other ways to have determined quad covering the clip
616 clipX.store(quad->fDevice.xs());
617 clipY.store(quad->fDevice.ys());
618 quad->fDevice.setQuadType(GrQuad::Type::kAxisAligned);
621 quad->fEdgeFlags = cropAA == GrAA::kYes ? GrQuadAAFlags::kAll : GrQuadAAFlags::kNone;
632 bool WillUseHairline(const GrQuad& quad, GrAAType aaType, GrQuadAAFlags edgeFlags) {
640 if (quad.quadType() == GrQuad::Type::kAxisAligned) {
644 float d = std::min(std::abs(quad.x(3) - quad.x(0)), std::abs(quad.y(3) - quad.y(0)));
648 helper.reset(quad, nullptr);
663 // Calculate all projected edge vector values for this quad.
736 // are less than 1px, then the inset geometry would be a point or line and quad rendering
799 // the center of the original quad to ensure it is contained in the intended geometry. Since
828 // have cases where the intersection lies far outside the quad. For example, consider top
933 // Set vertices to match the device and local quad
978 // When the projected device quad is not degenerate, the vertex corners can move
1077 // computed screen space position but moves the 3D point off of the original quad. So far, this
1122 // Compute vertex properties that are always needed for a quad, so no point in doing it lazily.
1250 // A degenerate rectilinear quad is either a point (both w and h crossed), or a line