39#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
40 int numVerbs =
path.countVerbs();
41 if (numVerbs > 0 && !
path.isInverseFillType()) {
47 if (clippedDrawBounds.
intersect(drawBounds)) {
48 float gpuFragmentWork = clippedDrawBounds.
height() * clippedDrawBounds.
width();
49 float cpuTessellationWork = numVerbs *
SkNextLog2(numVerbs);
50 constexpr static float kCpuWeight = 512;
51 constexpr static float kMinNumPixelsToTriangulate = 256 * 256;
52 if (cpuTessellationWork * kCpuWeight + kMinNumPixelsToTriangulate < gpuFragmentWork) {
53 return GrOp::Make<skgpu::ganesh::PathInnerTriangulateOp>(rContext,
65 return GrOp::Make<skgpu::ganesh::PathStencilCoverOp>(
66 rContext, arena, viewMatrix, path, std::move(
paint), aaType, fillPathFlags, drawBounds);
94 args.fViewMatrix->hasPerspective() ||
96 !
args.fProxy->canUseStencil(*
args.fCaps)) {
113 if (
args.fHasUserStencilSettings) {
124 auto sdc =
args.fSurfaceDrawContext;
127 args.fShape->asPath(&path);
129 const SkRect pathDevBounds =
args.fViewMatrix->mapRect(
args.fShape->bounds());
131 pathDevBounds.
width(),
138 if (!
args.fShape->style().isSimpleFill()) {
141 float inflationRadius;
151 viewport.
outset(inflationRadius, inflationRadius);
157 if (!
args.fShape->style().isSimpleFill()) {
158 SkASSERT(!path.isInverseFillType());
162 auto op = GrOp::Make<StrokeTessellateOp>(
args.fContext,
args.fAAType, *
args.fViewMatrix,
163 path, stroke, std::move(
args.fPaint));
164 sdc->addDrawOp(
args.fClip, std::move(op));
170 if (path.isInverseFillType()) {
171 args.fSurfaceDrawContext->drawPaint(
args.fClip, std::move(
args.fPaint),
179 if (path.isConvex() && !path.isInverseFillType()) {
180 auto op = GrOp::Make<PathTessellateOp>(
args.fContext,
181 args.fSurfaceDrawContext->arenaAlloc(),
183 args.fUserStencilSettings,
186 std::move(
args.fPaint),
188 sdc->addDrawOp(
args.fClip, std::move(op));
193 const SkRect& drawBounds = path.isInverseFillType()
194 ?
args.fSurfaceDrawContext->asSurfaceProxy()->backingStoreBoundsRect()
196 auto op = make_non_convex_fill_op(
args.fContext,
197 args.fSurfaceDrawContext->arenaAlloc(),
201 *
args.fClipConservativeBounds,
204 std::move(
args.fPaint));
205 sdc->addDrawOp(
args.fClip, std::move(op));
213 auto sdc =
args.fSurfaceDrawContext;
217 args.fViewMatrix->mapRect(&pathDevBounds,
args.fShape->bounds());
220 args.fShape->asPath(&path);
223 pathDevBounds.
width(),
231 if (path.isConvex()) {
243 auto op = GrOp::Make<PathTessellateOp>(
args.fContext,
244 args.fSurfaceDrawContext->arenaAlloc(),
249 std::move(stencilPaint),
251 sdc->addDrawOp(
args.fClip, std::move(op));
255 auto op = make_non_convex_fill_op(
args.fContext,
256 args.fSurfaceDrawContext->arenaAlloc(),
260 *
args.fClipConservativeBounds,
264 sdc->addDrawOp(
args.fClip, std::move(op));
static int SkNextLog2(uint32_t value)
bool avoidStencilBuffers() const
bool drawInstancedSupport() const
bool disableTessellationPathRenderer() const
static const GrDisableColorXPFactory * Get()
std::unique_ptr< GrOp > Owner
void setXPFactory(const GrXPFactory *xpFactory)
bool hasPathEffect() const
bool isSimpleFill() const
const SkStrokeRec & strokeRec() const
bool knownToBeConvex() const
bool inverseFilled() const
const GrStyle & style() const
static SkScalar GetInflationRadius(const SkPaint &, SkPaint::Style)
SkScalar getInflationRadius() const
bool isHairlineStyle() const
SkScalar getWidth() const
SkPaint::Join getJoin() const
SkPaint::Cap getCap() const
SkScalar getMiter() const
@ kNoRestriction_StencilSupport
@ kNoSupport_StencilSupport
@ kStencilOnly_StencilSupport
CanDrawPath onCanDrawPath(const CanDrawPathArgs &) const override
bool onDrawPath(const DrawPathArgs &) override
void onStencilPath(const StencilPathArgs &) override
static bool IsSupported(const GrCaps &)
StencilSupport onGetStencilSupport(const GrStyledShape &) const override
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static constexpr GrUserStencilSettings kMarkStencil(GrUserStencilSettings::StaticInit< 0x0001, GrUserStencilTest::kLessIfInClip, 0x0000, GrUserStencilOp::kZero, GrUserStencilOp::kReplace, 0xffff >())
static constexpr float kMaxSegmentsPerCurve_p4
SkPath PreChopPathCurves(float tessellationPrecision, const SkPath &path, const SkMatrix &matrix, const SkRect &viewport)
static constexpr float kPrecision
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > StaticInit()
static SkRect Make(const SkISize &size)
bool intersect(const SkRect &r)
void outset(float dx, float dy)
constexpr float height() const
constexpr float width() const