@@ -347,9 +347,8 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip,
347347 GrPaint paint;
348348 clear_to_grpaint (color, &paint);
349349 this ->addDrawOp (GrFixedClip::Disabled (),
350- GrFillRectOp::MakeGeneric (fContext , std::move (paint),
351- GrAAType::kNone , GrQuadAAFlags::kNone ,
352- GrPerspQuad (rtRect), GrPerspQuad (rtRect)));
350+ GrFillRectOp::Make (fContext , std::move (paint),
351+ GrAAType::kNone , SkMatrix::I (), rtRect));
353352 } else {
354353 this ->getRTOpList ()->addOp (GrClearOp::Make (fContext , SkIRect::MakeEmpty (), color,
355354 /* fullscreen */ true ), *this ->caps ());
@@ -361,10 +360,8 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip,
361360 GrPaint paint;
362361 clear_to_grpaint (color, &paint);
363362
364- this ->addDrawOp (clip,
365- GrFillRectOp::MakeGeneric (fContext , std::move (paint),
366- GrAAType::kNone , GrQuadAAFlags::kNone ,
367- GrPerspQuad (scissor), GrPerspQuad (scissor)));
363+ this ->addDrawOp (clip, GrFillRectOp::Make (fContext , std::move (paint), GrAAType::kNone ,
364+ SkMatrix::I (), scissor));
368365 } else {
369366 std::unique_ptr<GrOp> op (GrClearOp::Make (fContext , clip, color,
370367 this ->asSurfaceProxy ()));
@@ -408,14 +405,16 @@ void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const SkPMCol
408405 if (fRenderTargetContext ->caps ()->performPartialClearsAsDraws ()) {
409406 GrPaint paint;
410407 clear_to_grpaint (color, &paint);
411- GrPerspQuad clearQuad ( SkRect::Make (rtRect));
408+
412409 // Use the disabled clip; the rect geometry already matches the clear rectangle and
413410 // if it were added to a scissor, that would be intersected with the logical surface
414411 // bounds and not the worst case dimensions required here.
415412 fRenderTargetContext ->addDrawOp (GrFixedClip::Disabled (),
416- GrFillRectOp::MakeGeneric (fRenderTargetContext ->fContext , std::move (paint),
417- GrAAType::kNone , GrQuadAAFlags::kNone ,
418- clearQuad, clearQuad));
413+ GrFillRectOp::Make (fRenderTargetContext ->fContext ,
414+ std::move (paint),
415+ GrAAType::kNone ,
416+ SkMatrix::I (),
417+ SkRect::Make (rtRect)));
419418 } else {
420419 // Must use the ClearOp factory that takes a boolean (false) instead of a surface
421420 // proxy. The surface proxy variant would intersect the clip rect with its logical
@@ -435,11 +434,12 @@ void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const SkPMCol
435434 // width and height like in internalClear().
436435 GrPaint paint;
437436 clear_to_grpaint (color, &paint);
438- GrPerspQuad clearQuad (SkRect::Make (rtRect));
439437 fRenderTargetContext ->addDrawOp (GrFixedClip::Disabled (),
440- GrFillRectOp::MakeGeneric (fRenderTargetContext ->fContext , std::move (paint),
441- GrAAType::kNone , GrQuadAAFlags::kNone ,
442- clearQuad, clearQuad));
438+ GrFillRectOp::Make (fRenderTargetContext ->fContext ,
439+ std::move (paint),
440+ GrAAType::kNone ,
441+ SkMatrix::I (),
442+ SkRect::Make (rtRect)));
443443 } else {
444444 // Nothing special about this path in absClear compared to internalClear()
445445 fRenderTargetContext ->getRTOpList ()->addOp (
@@ -501,9 +501,8 @@ void GrRenderTargetContext::drawPaint(const GrClip& clip,
501501 }
502502
503503 AutoCheckFlush acf (this ->drawingManager ());
504- std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeGeneric (
505- fContext , std::move (paint), GrAAType::kNone , GrQuadAAFlags::kNone ,
506- GrPerspQuad (r), GrPerspQuad::MakeFromRect (r, localMatrix));
504+ std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeWithLocalMatrix (
505+ fContext , std::move (paint), GrAAType::kNone , SkMatrix::I (), localMatrix, r);
507506 this ->addDrawOp (clip, std::move (op));
508507}
509508
@@ -698,8 +697,8 @@ bool GrRenderTargetContext::drawFilledRectAsClear(const GrClip& clip, GrPaint&&
698697 aa = edgeFlags == GrQuadAAFlags::kNone ? GrAA::kNo : GrAA::kYes ;
699698 GrAAType aaType = this ->chooseAAType (aa);
700699 this ->addDrawOp (GrFixedClip::Disabled (),
701- GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, edgeFlags,
702- GrPerspQuad (combinedRect ), GrPerspQuad ( combinedRect) ));
700+ GrFillRectOp::MakePerEdge (fContext , std::move (paint), aaType, edgeFlags,
701+ SkMatrix::I ( ), combinedRect));
703702 return true ;
704703}
705704
@@ -725,9 +724,8 @@ void GrRenderTargetContext::drawFilledRect(const GrClip& clip,
725724 }
726725
727726 GrAAType aaType = this ->chooseAAType (aa);
728- this ->addDrawOp (clip, GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType,
729- aa == GrAA::kYes ? GrQuadAAFlags::kAll : GrQuadAAFlags::kNone ,
730- GrPerspQuad::MakeFromRect (croppedRect, viewMatrix), GrPerspQuad (croppedRect), ss));
727+ this ->addDrawOp (clip, GrFillRectOp::Make (fContext , std::move (paint), aaType, viewMatrix,
728+ croppedRect, ss));
731729}
732730
733731void GrRenderTargetContext::drawRect (const GrClip& clip,
@@ -835,14 +833,14 @@ void GrRenderTargetContext::internalStencilClear(const GrFixedClip& clip, bool i
835833
836834 // Configure the paint to have no impact on the color buffer
837835 GrPaint paint;
838- paint.setXPFactory (GrDisableColorXPFactory::Get ());
836+ paint.setColor4f ({0 .f , 0 .f , 0 .f , 0 .f });
837+ paint.setPorterDuffXPFactory (SkBlendMode::kSrcOver );
839838
840839 // Mark stencil usage here before addDrawOp() so that it doesn't try to re-call
841840 // internalStencilClear() just because the op has stencil settings.
842841 this ->setNeedsStencil ();
843- GrPerspQuad clearRect (rtRect);
844- this ->addDrawOp (clip, GrFillRectOp::MakeGeneric (fContext , std::move (paint), GrAAType::kNone ,
845- GrQuadAAFlags::kNone , clearRect, clearRect, ss));
842+ this ->addDrawOp (clip, GrFillRectOp::Make (fContext , std::move (paint),
843+ GrAAType::kNone , SkMatrix::I (), rtRect, ss));
846844 } else {
847845 std::unique_ptr<GrOp> op (GrClearStencilClipOp::Make (fContext , clip, insideStencilMask,
848846 fRenderTargetProxy .get ()));
@@ -910,9 +908,8 @@ void GrRenderTargetContextPriv::stencilRect(const GrHardClip& clip,
910908 GrPaint paint;
911909 paint.setXPFactory (GrDisableColorXPFactory::Get ());
912910 auto aaType = (GrAA::kYes == doStencilMSAA) ? GrAAType::kMSAA : GrAAType::kNone ;
913- std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeGeneric (
914- fRenderTargetContext ->fContext , std::move (paint), aaType, GrQuadAAFlags::kNone ,
915- GrPerspQuad::MakeFromRect (rect, viewMatrix), GrPerspQuad (rect), ss);
911+ std::unique_ptr<GrDrawOp> op = GrFillRectOp::Make (
912+ fRenderTargetContext ->fContext , std::move (paint), aaType, viewMatrix, rect, ss);
916913 fRenderTargetContext ->addDrawOp (clip, std::move (op));
917914}
918915
@@ -959,9 +956,8 @@ void GrRenderTargetContext::fillRectWithEdgeAA(const GrClip& clip, GrPaint&& pai
959956 &croppedLocalRect)) {
960957 return ;
961958 }
962- op = GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, edgeAA,
963- GrPerspQuad::MakeFromRect (croppedRect, viewMatrix),
964- GrPerspQuad (croppedLocalRect));
959+ op = GrFillRectOp::MakePerEdgeWithLocalRect (fContext , std::move (paint), aaType, edgeAA,
960+ viewMatrix, croppedRect, croppedLocalRect);
965961 } else {
966962 // If aaType turns into MSAA, make sure to keep quads with no AA edges as MSAA. Sending
967963 // those to drawFilledRect() would have it turn off MSAA in that case, which breaks seaming
@@ -979,8 +975,8 @@ void GrRenderTargetContext::fillRectWithEdgeAA(const GrClip& clip, GrPaint&& pai
979975 if (!crop_filled_rect (this ->width (), this ->height (), clip, viewMatrix, &croppedRect)) {
980976 return ;
981977 }
982- op = GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, edgeAA,
983- GrPerspQuad::MakeFromRect (croppedRect, viewMatrix), GrPerspQuad ( croppedRect) );
978+ op = GrFillRectOp::MakePerEdge (fContext , std::move (paint), aaType, edgeAA, viewMatrix ,
979+ croppedRect);
984980 }
985981
986982 AutoCheckFlush acf (this ->drawingManager ());
@@ -998,10 +994,9 @@ void GrRenderTargetContext::fillQuadWithEdgeAA(const GrClip& clip, GrPaint&& pai
998994 GrAAType aaType = this ->chooseAAType (aa);
999995
1000996 AutoCheckFlush acf (this ->drawingManager ());
1001- const SkPoint* localPoints = localQuad ? localQuad : quad;
1002- this ->addDrawOp (clip, GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, edgeAA,
1003- GrPerspQuad::MakeFromSkQuad (quad, viewMatrix),
1004- GrPerspQuad::MakeFromSkQuad (localPoints, SkMatrix::I ())));
997+ // MakePerEdgeQuad automatically does the right thing if localQuad is null or not
998+ this ->addDrawOp (clip, GrFillRectOp::MakePerEdgeQuad (fContext , std::move (paint), aaType, edgeAA,
999+ viewMatrix, quad, localQuad));
10051000}
10061001
10071002// Creates a paint for GrFillRectOp that matches behavior of GrTextureOp
@@ -1067,8 +1062,8 @@ void GrRenderTargetContext::drawTexture(const GrClip& clip, sk_sp<GrTextureProxy
10671062 draw_texture_to_grpaint (std::move (proxy),
10681063 constraint == SkCanvas::kStrict_SrcRectConstraint ? &srcRect : nullptr ,
10691064 filter, mode, color, std::move (textureColorSpaceXform), &paint);
1070- op = GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, aaFlags,
1071- GrPerspQuad::MakeFromRect (clippedDstRect, viewMatrix), GrPerspQuad ( clippedSrcRect) );
1065+ op = GrFillRectOp::MakePerEdgeWithLocalRect (fContext , std::move (paint), aaType, aaFlags,
1066+ viewMatrix, clippedDstRect, clippedSrcRect);
10721067 } else {
10731068 // Can use a lighter weight op that can chain across proxies
10741069 op = GrTextureOp::Make (fContext , std::move (proxy), filter, color, clippedSrcRect,
@@ -1106,9 +1101,8 @@ void GrRenderTargetContext::drawTextureQuad(const GrClip& clip, sk_sp<GrTextureP
11061101 GrPaint paint;
11071102 draw_texture_to_grpaint (
11081103 std::move (proxy), domain, filter, mode, color, std::move (texXform), &paint);
1109- op = GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType, aaFlags,
1110- GrPerspQuad::MakeFromSkQuad (dstQuad, viewMatrix),
1111- GrPerspQuad::MakeFromSkQuad (srcQuad, SkMatrix::I ()));
1104+ op = GrFillRectOp::MakePerEdgeQuad (fContext , std::move (paint), aaType, aaFlags, viewMatrix,
1105+ dstQuad, srcQuad);
11121106 } else {
11131107 // Use lighter weight GrTextureOp
11141108 op = GrTextureOp::MakeQuad (fContext , std::move (proxy), filter, color, srcQuad, dstQuad,
@@ -1185,10 +1179,8 @@ void GrRenderTargetContext::fillRectWithLocalMatrix(const GrClip& clip,
11851179 AutoCheckFlush acf (this ->drawingManager ());
11861180
11871181 GrAAType aaType = this ->chooseAAType (aa);
1188- this ->addDrawOp (clip, GrFillRectOp::MakeGeneric (fContext , std::move (paint), aaType,
1189- aa == GrAA::kYes ? GrQuadAAFlags::kAll : GrQuadAAFlags::kNone ,
1190- GrPerspQuad::MakeFromRect (rectToDraw, viewMatrix),
1191- GrPerspQuad::MakeFromRect (rectToDraw, localMatrix)));
1182+ this ->addDrawOp (clip, GrFillRectOp::MakeWithLocalMatrix (fContext , std::move (paint), aaType,
1183+ viewMatrix, localMatrix, croppedRect));
11921184}
11931185
11941186void GrRenderTargetContext::drawVertices (const GrClip& clip,
0 commit comments