#include "src/gpu/ganesh/ops/GrSimpleMeshDrawOpHelper.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkArenaAlloc.h"
#include "src/gpu/Swizzle.h"
#include "src/gpu/ganesh/GrAppliedClip.h"
#include "src/gpu/ganesh/GrDstProxyView.h"
#include "src/gpu/ganesh/GrOpFlushState.h"
#include "src/gpu/ganesh/GrProcessorAnalysis.h"
#include "src/gpu/ganesh/GrProcessorSet.h"
#include "src/gpu/ganesh/GrProgramInfo.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/ops/GrMeshDrawOp.h"
enum class GrXferBarrierFlags;
struct SkRect;
GrSimpleMeshDrawOpHelper::GrSimpleMeshDrawOpHelper(GrProcessorSet* processorSet,
GrAAType aaType,
InputFlags inputFlags)
: … { … }
GrSimpleMeshDrawOpHelper::~GrSimpleMeshDrawOpHelper() { … }
GrDrawOp::FixedFunctionFlags GrSimpleMeshDrawOpHelper::fixedFunctionFlags() const { … }
bool GrSimpleMeshDrawOpHelper::isCompatible(const GrSimpleMeshDrawOpHelper& that,
const GrCaps& caps, const SkRect& thisBounds,
const SkRect& thatBounds, bool ignoreAAType) const { … }
GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors(
const GrCaps& caps, const GrAppliedClip* clip, GrClampType clampType,
GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f* geometryColor, bool* wideColor) { … }
GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors(
const GrCaps& caps, const GrAppliedClip* clip, const GrUserStencilSettings* userStencil,
GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage,
GrProcessorAnalysisColor* geometryColor) { … }
const GrPipeline* GrSimpleMeshDrawOpHelper::CreatePipeline(const GrCaps* caps,
SkArenaAlloc* arena,
skgpu::Swizzle writeViewSwizzle,
GrAppliedClip&& appliedClip,
const GrDstProxyView& dstProxyView,
GrProcessorSet&& processorSet,
GrPipeline::InputFlags pipelineFlags) { … }
const GrPipeline* GrSimpleMeshDrawOpHelper::CreatePipeline(GrOpFlushState* flushState,
GrProcessorSet&& processorSet,
GrPipeline::InputFlags pipelineFlags) { … }
const GrPipeline* GrSimpleMeshDrawOpHelper::createPipeline(GrOpFlushState* flushState) { … }
const GrPipeline* GrSimpleMeshDrawOpHelper::createPipeline(const GrCaps* caps,
SkArenaAlloc* arena,
skgpu::Swizzle writeViewSwizzle,
GrAppliedClip&& appliedClip,
const GrDstProxyView& dstProxyView) { … }
GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(
const GrCaps* caps,
SkArenaAlloc* arena,
const GrSurfaceProxyView& writeView,
bool usesMSAASurface,
GrAppliedClip&& appliedClip,
const GrDstProxyView& dstProxyView,
GrGeometryProcessor* geometryProcessor,
GrProcessorSet&& processorSet,
GrPrimitiveType primitiveType,
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp,
GrPipeline::InputFlags pipelineFlags,
const GrUserStencilSettings* stencilSettings) { … }
GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(const GrCaps* caps,
SkArenaAlloc* arena,
const GrPipeline* pipeline,
const GrSurfaceProxyView& writeView,
bool usesMSAASurface,
GrGeometryProcessor* geometryProcessor,
GrPrimitiveType primitiveType,
GrXferBarrierFlags xferBarrierFlags,
GrLoadOp colorLoadOp,
const GrUserStencilSettings* stencilSettings) { … }
GrProgramInfo* GrSimpleMeshDrawOpHelper::createProgramInfo(
const GrCaps* caps,
SkArenaAlloc* arena,
const GrSurfaceProxyView& writeView,
bool usesMSAASurface,
GrAppliedClip&& appliedClip,
const GrDstProxyView& dstProxyView,
GrGeometryProcessor* gp,
GrPrimitiveType primType,
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp) { … }
#if defined(GPU_TEST_UTILS)
static void dump_pipeline_flags(GrPipeline::InputFlags flags, SkString* result) {
if (GrPipeline::InputFlags::kNone != flags) {
if (flags & GrPipeline::InputFlags::kSnapVerticesToPixelCenters) {
result->append("Snap vertices to pixel center.\n");
}
if (flags & GrPipeline::InputFlags::kWireframe) {
result->append("Wireframe enabled.\n");
}
if (flags & GrPipeline::InputFlags::kConservativeRaster) {
result->append("Conservative raster enabled.\n");
}
return;
}
result->append("No pipeline flags\n");
}
SkString GrSimpleMeshDrawOpHelper::dumpInfo() const {
const GrProcessorSet& processors = fProcessors ? *fProcessors : GrProcessorSet::EmptySet();
SkString result = processors.dumpProcessors();
result.append("AA Type: ");
switch (this->aaType()) {
case GrAAType::kNone:
result.append(" none\n");
break;
case GrAAType::kCoverage:
result.append(" coverage\n");
break;
case GrAAType::kMSAA:
result.append(" msaa\n");
break;
}
dump_pipeline_flags(fPipelineFlags, &result);
return result;
}
#endif