Make stencilRect() in GrRTCPriv more flexible.
All GrFillRectOps in core code go through a GrRTC call.
Also adds a utility constructor for non-AA rects since this simplifies clears
and tests/GMs that called GrFillRectOp directly. This helps preserve
readability without forcing them to go through the full rect drawing pipeline.
Change-Id: I6694c1aded3b89d773a897c483f7f2a51b06e6e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215089
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index a314ae7..20e28fd 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -19,10 +19,10 @@
#include "src/gpu/GrMesh.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrPathUtils.h"
+#include "src/gpu/GrRenderTargetContextPriv.h"
#include "src/gpu/GrShape.h"
#include "src/gpu/GrStyle.h"
#include "src/gpu/GrSurfaceContextPriv.h"
-#include "src/gpu/ops/GrFillRectOp.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h"
@@ -613,10 +613,8 @@
viewMatrix;
// This is a non-coverage aa rect op since we assert aaType != kCoverage at the start
assert_alive(paint);
- renderTargetContext->addDrawOp(
- clip,
- GrFillRectOp::MakeWithLocalMatrix(context, std::move(paint), aaType, viewM,
- localMatrix, bounds, passes[p]));
+ renderTargetContext->priv().stencilRect(clip, passes[p], std::move(paint),
+ GrAA(aaType == GrAAType::kMSAA), viewM, bounds, &localMatrix);
} else {
bool stencilPass = stencilOnly || passCount > 1;
std::unique_ptr<GrDrawOp> op;