Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
DrawMeshHelper Class Reference

Public Member Functions

 DrawMeshHelper (GrOpFlushState *state)
 
sk_sp< const GrBuffergetIndexBuffer ()
 
sk_sp< const GrBuffermakeIndexBuffer (const uint16_t[], int count)
 
template<typename T >
sk_sp< const GrBuffermakeVertexBuffer (const TArray< T > &data)
 
template<typename T >
sk_sp< const GrBuffermakeVertexBuffer (const std::vector< T > &data)
 
template<typename T >
sk_sp< const GrBuffermakeVertexBuffer (const T *data, int count)
 
GrMeshDrawTargettarget ()
 
GrOpsRenderPassbindPipeline (GrPrimitiveType, bool isInstanced, bool hasVertexBuffer)
 

Public Attributes

sk_sp< const GrBufferfIndexBuffer
 
sk_sp< const GrBufferfIndexBuffer2
 
sk_sp< const GrBufferfInstBuffer
 
sk_sp< const GrBufferfVertBuffer
 
sk_sp< const GrBufferfVertBuffer2
 
sk_sp< const GrBufferfDrawIndirectBuffer
 
size_t fDrawIndirectBufferOffset
 

Detailed Description

Definition at line 96 of file GrMeshTest.cpp.

Constructor & Destructor Documentation

◆ DrawMeshHelper()

DrawMeshHelper::DrawMeshHelper ( GrOpFlushState state)
inline

Definition at line 98 of file GrMeshTest.cpp.

98: fState(state) {}
AtkStateType state

Member Function Documentation

◆ bindPipeline()

GrOpsRenderPass * DrawMeshHelper::bindPipeline ( GrPrimitiveType  primitiveType,
bool  isInstanced,
bool  hasVertexBuffer 
)

Definition at line 609 of file GrMeshTest.cpp.

610 {
611 GrProcessorSet processorSet(SkBlendMode::kSrc);
612
613 // TODO: add a GrProcessorSet testing helper to make this easier
614 SkPMColor4f overrideColor;
615 processorSet.finalize(GrProcessorAnalysisColor(),
617 fState->appliedClip(),
618 nullptr,
619 fState->caps(),
621 &overrideColor);
622
623 auto pipeline = GrSimpleMeshDrawOpHelper::CreatePipeline(fState,
624 std::move(processorSet),
626
627 GrGeometryProcessor* mtp = MeshTestProcessor::Make(fState->allocator(), isInstanced,
628 hasVertexBuffer);
629
630 GrProgramInfo programInfo(fState->caps(), fState->writeView(), fState->usesMSAASurface(),
631 pipeline, &GrUserStencilSettings::kUnused, mtp, primitiveType,
632 fState->renderPassBarriers(), fState->colorLoadOp());
633
635 return fState->opsRenderPass();
636}
static constexpr int kImageWidth
Definition: GrMeshTest.cpp:89
static constexpr int kImageHeight
Definition: GrMeshTest.cpp:90
GrLoadOp colorLoadOp() const final
GrXferBarrierFlags renderPassBarriers() const final
SkArenaAlloc * allocator() override
const GrAppliedClip * appliedClip() const final
const GrSurfaceProxyView & writeView() const final
const GrCaps & caps() const final
GrOpsRenderPass * opsRenderPass()
bool usesMSAASurface() const final
void bindPipeline(const GrProgramInfo &, const SkRect &drawBounds)
static const GrPipeline * CreatePipeline(const GrCaps *, SkArenaAlloc *, skgpu::Swizzle writeViewSwizzle, GrAppliedClip &&, const GrDstProxyView &, GrProcessorSet &&, GrPipeline::InputFlags pipelineFlags)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
static const GrUserStencilSettings & kUnused
static SkRect MakeIWH(int w, int h)
Definition: SkRect.h:623

◆ getIndexBuffer()

sk_sp< const GrBuffer > DrawMeshHelper::getIndexBuffer ( )

Definition at line 603 of file GrMeshTest.cpp.

603 {
604 SKGPU_DEFINE_STATIC_UNIQUE_KEY(gIndexBufferKey);
606 kIndexPattern, 6, kIndexPatternRepeatCount, 4, gIndexBufferKey);
607}
constexpr uint16_t kIndexPattern[6]
Definition: GrMeshTest.cpp:93
static constexpr int kIndexPatternRepeatCount
Definition: GrMeshTest.cpp:92
#define SKGPU_DEFINE_STATIC_UNIQUE_KEY(name)
Definition: ResourceKey.h:324
GrResourceProvider * resourceProvider() const final
sk_sp< const GrGpuBuffer > findOrCreatePatternedIndexBuffer(const uint16_t *pattern, int patternSize, int reps, int vertCount, const skgpu::UniqueKey &key)

◆ makeIndexBuffer()

sk_sp< const GrBuffer > DrawMeshHelper::makeIndexBuffer ( const uint16_t  indices[],
int  count 
)

Definition at line 588 of file GrMeshTest.cpp.

588 {
589 return fState->resourceProvider()->createBuffer(indices,
590 count*sizeof(uint16_t),
593}
int count
Definition: FontMgrTest.cpp:50
@ kDynamic_GrAccessPattern
Definition: GrTypesPriv.h:426
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType, GrAccessPattern, ZeroInit)

◆ makeVertexBuffer() [1/3]

template<typename T >
sk_sp< const GrBuffer > DrawMeshHelper::makeVertexBuffer ( const std::vector< T > &  data)
inline

Definition at line 107 of file GrMeshTest.cpp.

107 {
108 return this->makeVertexBuffer(data.data(), data.size());
109 }
sk_sp< const GrBuffer > makeVertexBuffer(const TArray< T > &data)
Definition: GrMeshTest.cpp:104
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ makeVertexBuffer() [2/3]

template<typename T >
sk_sp< const GrBuffer > DrawMeshHelper::makeVertexBuffer ( const T data,
int  count 
)

Definition at line 596 of file GrMeshTest.cpp.

596 {
597 return fState->resourceProvider()->createBuffer(data,
598 count*sizeof(T),
601}
#define T
Definition: precompiler.cc:65

◆ makeVertexBuffer() [3/3]

template<typename T >
sk_sp< const GrBuffer > DrawMeshHelper::makeVertexBuffer ( const TArray< T > &  data)
inline

Definition at line 104 of file GrMeshTest.cpp.

104 {
105 return this->makeVertexBuffer(data.begin(), data.size());
106 }

◆ target()

GrMeshDrawTarget * DrawMeshHelper::target ( )
inline

Definition at line 112 of file GrMeshTest.cpp.

112{ return fState; }

Member Data Documentation

◆ fDrawIndirectBuffer

sk_sp<const GrBuffer> DrawMeshHelper::fDrawIndirectBuffer

Definition at line 119 of file GrMeshTest.cpp.

◆ fDrawIndirectBufferOffset

size_t DrawMeshHelper::fDrawIndirectBufferOffset

Definition at line 120 of file GrMeshTest.cpp.

◆ fIndexBuffer

sk_sp<const GrBuffer> DrawMeshHelper::fIndexBuffer

Definition at line 114 of file GrMeshTest.cpp.

◆ fIndexBuffer2

sk_sp<const GrBuffer> DrawMeshHelper::fIndexBuffer2

Definition at line 115 of file GrMeshTest.cpp.

◆ fInstBuffer

sk_sp<const GrBuffer> DrawMeshHelper::fInstBuffer

Definition at line 116 of file GrMeshTest.cpp.

◆ fVertBuffer

sk_sp<const GrBuffer> DrawMeshHelper::fVertBuffer

Definition at line 117 of file GrMeshTest.cpp.

◆ fVertBuffer2

sk_sp<const GrBuffer> DrawMeshHelper::fVertBuffer2

Definition at line 118 of file GrMeshTest.cpp.


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