#include "src/gpu/ganesh/ops/DrawMeshOp.h"
#include "include/core/SkColor.h"
#include "include/core/SkData.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkMesh.h"
#include "include/core/SkString.h"
#include "include/core/SkVertices.h"
#include "include/effects/SkRuntimeEffect.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkSpan_impl.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "include/private/base/SkTypeTraits.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkArenaAlloc.h"
#include "src/core/SkMeshPriv.h"
#include "src/core/SkRuntimeEffectPriv.h"
#include "src/core/SkSLTypeShared.h"
#include "src/core/SkVerticesPriv.h"
#include "src/gpu/BufferWriter.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrAppliedClip.h"
#include "src/gpu/ganesh/GrBuffer.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrColorSpaceXform.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrGeometryProcessor.h"
#include "src/gpu/ganesh/GrMeshBuffers.h"
#include "src/gpu/ganesh/GrMeshDrawTarget.h"
#include "src/gpu/ganesh/GrOpFlushState.h"
#include "src/gpu/ganesh/GrPaint.h"
#include "src/gpu/ganesh/GrProcessorAnalysis.h"
#include "src/gpu/ganesh/GrProcessorSet.h"
#include "src/gpu/ganesh/GrProgramInfo.h"
#include "src/gpu/ganesh/GrShaderVar.h"
#include "src/gpu/ganesh/GrSimpleMesh.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLColorSpaceXformHelper.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include "src/gpu/ganesh/glsl/GrGLSLVarying.h"
#include "src/gpu/ganesh/glsl/GrGLSLVertexGeoBuilder.h"
#include "src/gpu/ganesh/ops/GrDrawOp.h"
#include "src/gpu/ganesh/ops/GrMeshDrawOp.h"
#include "src/gpu/ganesh/ops/GrSimpleMeshDrawOpHelper.h"
#include "src/sksl/SkSLString.h"
#include "src/sksl/SkSLUtil.h"
#include "src/sksl/codegen/SkSLPipelineStageCodeGenerator.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLVarDeclarations.h"
#include "src/sksl/ir/SkSLVariable.h"
#include <algorithm>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iterator>
#include <new>
#include <optional>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
class GrDstProxyView;
class GrGpuBuffer;
enum class GrXferBarrierFlags;
namespace SkSL {
class Context;
}
struct GrShaderCaps;
struct SkRect;
usingnamespaceskia_private;
namespace {
GrPrimitiveType primitive_type(SkMesh::Mode mode) { … }
MeshAttributeType;
GrVertexAttribType attrib_type(MeshAttributeType type) { … }
class MeshGP : public GrGeometryProcessor { … };
class MeshOp final : public GrMeshDrawOp { … };
MeshOp::Mesh::Mesh(const SkMesh& mesh) { … }
MeshOp::Mesh::Mesh(sk_sp<SkVertices> vertices, const SkMatrix& viewMatrix)
: … { … }
MeshOp::Mesh::Mesh(Mesh&& that) { … }
MeshOp::Mesh::~Mesh() { … }
void MeshOp::Mesh::writeVertices(skgpu::VertexWriter& writer,
const SkMeshSpecification& spec,
bool transform) const { … }
MeshOp::MeshOp(GrProcessorSet* processorSet,
const SkPMColor4f& color,
const SkMesh& mesh,
TArray<std::unique_ptr<GrFragmentProcessor>> children,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& viewMatrix)
: … { … }
static SkMeshSpecification* make_vertices_spec(bool hasColors, bool hasTex) { … }
MeshOp::MeshOp(GrProcessorSet* processorSet,
const SkPMColor4f& color,
sk_sp<SkVertices> vertices,
const GrPrimitiveType* overridePrimitiveType,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& viewMatrix)
: … { … }
#if defined(GPU_TEST_UTILS)
SkString MeshOp::onDumpInfo() const { return {}; }
#endif
GrDrawOp::FixedFunctionFlags MeshOp::fixedFunctionFlags() const { … }
GrProcessorSet::Analysis MeshOp::finalize(const GrCaps& caps,
const GrAppliedClip* clip,
GrClampType clampType) { … }
GrGeometryProcessor* MeshOp::makeGP(SkArenaAlloc* arena) { … }
void MeshOp::onCreateProgramInfo(const GrCaps* caps,
SkArenaAlloc* arena,
const GrSurfaceProxyView& writeView,
bool usesMSAASurface,
GrAppliedClip&& appliedClip,
const GrDstProxyView& dstProxyView,
GrXferBarrierFlags renderPassXferBarriers,
GrLoadOp colorLoadOp) { … }
void MeshOp::onPrepareDraws(GrMeshDrawTarget* target) { … }
void MeshOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) { … }
GrOp::CombineResult MeshOp::onCombineIfPossible(GrOp* t, SkArenaAlloc*, const GrCaps& caps) { … }
}
namespace skgpu::ganesh::DrawMeshOp {
GrOp::Owner Make(GrRecordingContext* context,
GrPaint&& paint,
const SkMesh& mesh,
TArray<std::unique_ptr<GrFragmentProcessor>> children,
const SkMatrix& viewMatrix,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform) { … }
GrOp::Owner Make(GrRecordingContext* context,
GrPaint&& paint,
sk_sp<SkVertices> vertices,
const GrPrimitiveType* overridePrimitiveType,
const SkMatrix& viewMatrix,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform) { … }
}