Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
skgpu::ganesh::FillRectOp Class Reference

#include <FillRectOp.h>

Public Types

using InputFlags = GrSimpleMeshDrawOpHelper::InputFlags
 

Static Public Member Functions

static GrOp::Owner Make (GrRecordingContext *, GrPaint &&, GrAAType, DrawQuad *, const GrUserStencilSettings *=nullptr, InputFlags=InputFlags::kNone)
 
static GrOp::Owner MakeNonAARect (GrRecordingContext *, GrPaint &&, const SkMatrix &view, const SkRect &, const GrUserStencilSettings *=nullptr)
 
static void AddFillRectOps (SurfaceDrawContext *, const GrClip *, GrRecordingContext *, GrPaint &&, GrAAType, const SkMatrix &viewMatrix, const GrQuadSetEntry quads[], int quadCount, const GrUserStencilSettings *=nullptr)
 

Detailed Description

A set of factory functions for drawing filled rectangles either coverage-antialiased, or non-antialiased. The non-antialiased ops can be used with MSAA. As with other GrDrawOp factories, the GrPaint is only consumed by these methods if a valid op is returned. If null is returned then the paint is unmodified and may still be used.

Definition at line 35 of file FillRectOp.h.

Member Typedef Documentation

◆ InputFlags

Definition at line 37 of file FillRectOp.h.

Member Function Documentation

◆ AddFillRectOps()

void skgpu::ganesh::FillRectOp::AddFillRectOps ( SurfaceDrawContext sdc,
const GrClip clip,
GrRecordingContext context,
GrPaint &&  paint,
GrAAType  aaType,
const SkMatrix viewMatrix,
const GrQuadSetEntry  quads[],
int  quadCount,
const GrUserStencilSettings stencilSettings = nullptr 
)
static

Definition at line 530 of file FillRectOp.cpp.

538 {
539 int offset = 0;
540 int numLeft = cnt;
541 while (numLeft) {
542 int numConsumed = 0;
543
544 GrOp::Owner op = MakeOp(context, GrPaint::Clone(paint), aaType, viewMatrix,
545 &quads[offset], numLeft, stencilSettings,
546 &numConsumed);
547
548 offset += numConsumed;
549 numLeft -= numConsumed;
550
551 sdc->addDrawOp(clip, std::move(op));
552 }
553
554 SkASSERT(offset == cnt);
555}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
std::unique_ptr< GrOp > Owner
Definition: GrOp.h:72
static GrPaint Clone(const GrPaint &src)
Definition: GrPaint.h:45
void addDrawOp(const GrClip *, GrOp::Owner, const std::function< WillAddOpFn > &=std::function< WillAddOpFn >())
const Paint & paint
Definition: color_source.cc:38
SeparatedVector2 offset

◆ Make()

GrOp::Owner skgpu::ganesh::FillRectOp::Make ( GrRecordingContext context,
GrPaint &&  paint,
GrAAType  aaType,
DrawQuad quad,
const GrUserStencilSettings stencil = nullptr,
InputFlags  inputFlags = InputFlags::kNone 
)
static

Definition at line 470 of file FillRectOp.cpp.

475 {
476 return FillRectOpImpl::Make(context, std::move(paint), aaType, std::move(quad), stencil,
477 inputFlags);
478}
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)

◆ MakeNonAARect()

GrOp::Owner skgpu::ganesh::FillRectOp::MakeNonAARect ( GrRecordingContext context,
GrPaint &&  paint,
const SkMatrix view,
const SkRect rect,
const GrUserStencilSettings stencil = nullptr 
)
static

Definition at line 480 of file FillRectOp.cpp.

484 {
486 return FillRectOpImpl::Make(context, std::move(paint), GrAAType::kNone, &quad, stencil,
488}
Definition: GrQuad.h:30
static GrQuad MakeFromRect(const SkRect &, const SkMatrix &)
Definition: GrQuad.cpp:107
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

The documentation for this class was generated from the following files: