Delete all low-level rendering from ccpr
This converts ccpr to just a poorly named atlas manager. The atlas
gets rendered by normal calls on its MSAA draw context:
for (;;) {
surfaceDrawContext->stencilPath(); // Stencil.
}
surfaceDrawContext->stencilRect(atlasBounds); // Cover.
Bug: chromium:1158093
Change-Id: I758ffd372b2ed5bb8b370156b6f80f6204146700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381618
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrSurfaceDrawContext.cpp b/src/gpu/GrSurfaceDrawContext.cpp
index 7556d15..628932c 100644
--- a/src/gpu/GrSurfaceDrawContext.cpp
+++ b/src/gpu/GrSurfaceDrawContext.cpp
@@ -746,6 +746,43 @@
}
}
+bool GrSurfaceDrawContext::stencilPath(const GrHardClip* clip,
+ GrAA doStencilMSAA,
+ const SkMatrix& viewMatrix,
+ const SkPath& path) {
+ SkIRect clipBounds = clip ? clip->getConservativeBounds()
+ : SkIRect::MakeSize(this->dimensions());
+ GrStyledShape shape(path, GrStyledShape::DoSimplify::kNo);
+
+ GrPathRenderer::CanDrawPathArgs canDrawArgs;
+ canDrawArgs.fCaps = fContext->priv().caps();
+ canDrawArgs.fProxy = this->asRenderTargetProxy();
+ canDrawArgs.fClipConservativeBounds = &clipBounds;
+ canDrawArgs.fViewMatrix = &viewMatrix;
+ canDrawArgs.fShape = &shape;
+ canDrawArgs.fPaint = nullptr;
+ canDrawArgs.fAAType = (doStencilMSAA == GrAA::kYes) ? GrAAType::kMSAA : GrAAType::kNone;
+ canDrawArgs.fHasUserStencilSettings = false;
+ canDrawArgs.fTargetIsWrappedVkSecondaryCB = this->wrapsVkSecondaryCB();
+ GrPathRenderer* pr = this->drawingManager()->getPathRenderer(
+ canDrawArgs, false, GrPathRendererChain::DrawType::kStencil);
+ if (!pr) {
+ SkDebugf("WARNING: No path renderer to stencil path.\n");
+ return false;
+ }
+
+ GrPathRenderer::StencilPathArgs args;
+ args.fContext = fContext;
+ args.fRenderTargetContext = this;
+ args.fClip = clip;
+ args.fClipConservativeBounds = &clipBounds;
+ args.fViewMatrix = &viewMatrix;
+ args.fShape = &shape;
+ args.fDoStencilMSAA = doStencilMSAA;
+ pr->stencilPath(args);
+ return true;
+}
+
void GrSurfaceDrawContext::stencilPath(const GrHardClip* clip,
GrAA doStencilMSAA,
const SkMatrix& viewMatrix,