50#include <initializer_list>
62namespace skgpu {
class KeyBuilder; }
101 [&](
void* ptr) {
return new (ptr) PipelineDynamicStateTestProcessor(); });
104 const char*
name()
const override {
return "GrPipelineDynamicStateTest Processor"; }
111 PipelineDynamicStateTestProcessor() :
INHERITED(kGrPipelineDynamicStateTestProcessor_ClassID) {
123 friend class GLSLPipelineDynamicStateTestProcessor;
128std::unique_ptr<GrGeometryProcessor::ProgramImpl>
129PipelineDynamicStateTestProcessor::makeProgramImpl(
const GrShaderCaps&)
const {
137 const PipelineDynamicStateTestProcessor& mp =
138 args.fGeomProc.cast<PipelineDynamicStateTestProcessor>();
144 f->codeAppendf(
"half4 %s;",
args.fOutputColor);
147 v->codeAppendf(
"float2 vertex = %s;", mp.inVertex().name());
149 f->codeAppendf(
"const half4 %s = half4(1);",
args.fOutputCoverage);
152 return std::make_unique<Impl>();
156class GrPipelineDynamicStateTestOp :
public GrDrawOp {
163 return GrOp::Make<GrPipelineDynamicStateTestOp>(context, scissorTest, std::move(vbuff));
171 , fScissorTest(scissorTest)
177 const char*
name()
const override {
return "GrPipelineDynamicStateTestOp"; }
211 for (
int i = 0;
i < 4; ++
i) {
230 auto dContext = ctxInfo.directContext();
285 sdc->readPixels(dContext, resultPM, {0, 0});
288 int expectedColorIdx;
296 if (expected != actual) {
297 ERRORF(
reporter,
"[scissor=%s] pixel (%i,%i): got 0x%x expected 0x%x",
static GrColor GrColorPackRGBA(unsigned r, unsigned g, unsigned b, unsigned a)
#define DEFINE_OP_CLASS_ID
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(GrPipelineDynamicStateTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
static constexpr int kScreenSplitY
static constexpr int kScreenSplitX
static constexpr int kNumMeshes
static const SkIRect kDynamicScissors[kNumMeshes]
static const GrColor kMeshColors[kNumMeshes]
static constexpr int kScreenSize
@ kDynamic_GrAccessPattern
@ kFloat2_GrVertexAttribType
@ kUByte4_norm_GrVertexAttribType
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define INHERITED(method,...)
sk_sp< const GrBuffer > fVertexBuffer
virtual FixedFunctionFlags fixedFunctionFlags() const
virtual GrProcessorSet::Analysis finalize(const GrCaps &, const GrAppliedClip *, GrClampType)=0
GrDrawOp(uint32_t classID)
void emitAttributes(const GrGeometryProcessor &)
void addPassThroughAttribute(const GrShaderVar &vsVar, const char *output, Interpolation=Interpolation::kInterpolated)
virtual void onEmitCode(EmitArgs &, GrGPArgs *)=0
virtual void setData(const GrGLSLProgramDataManager &, const GrShaderCaps &, const GrGeometryProcessor &)=0
GrGeometryProcessor(ClassID)
virtual std::unique_ptr< ProgramImpl > makeProgramImpl(const GrShaderCaps &) const =0
virtual void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const =0
void setVertexAttributesWithImplicitOffsets(const Attribute *attrs, int attrCount)
void setScissorRect(const SkIRect &scissorRect)
GrLoadOp colorLoadOp() const final
GrXferBarrierFlags renderPassBarriers() const final
SkArenaAlloc * allocator() override
void drawMesh(const GrSimpleMesh &mesh)
const GrSurfaceProxyView & writeView() const final
const GrCaps & caps() const final
void bindPipeline(const GrProgramInfo &programInfo, const SkRect &drawBounds)
const OpArgs & drawOpArgs() const
bool usesMSAASurface() const final
virtual void onExecute(GrOpFlushState *, const SkRect &chainBounds)=0
static Owner Make(GrRecordingContext *context, Args &&... args)
std::unique_ptr< GrOp > Owner
virtual void onPrepare(GrOpFlushState *)=0
virtual const char * name() const =0
virtual void onPrePrepare(GrRecordingContext *, const GrSurfaceProxyView &writeView, GrAppliedClip *, const GrDstProxyView &, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)=0
void setBounds(const SkRect &newBounds, HasAABloat aabloat, IsHairline zeroArea)
static constexpr Analysis EmptySetAnalysis()
virtual const char * name() const =0
sk_sp< GrGpuBuffer > createBuffer(size_t size, GrGpuBufferType, GrAccessPattern, ZeroInit)
GrResourceProviderPriv priv()
skgpu::Swizzle swizzle() const
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static const std::map< std::string, VerticesBuilder::AttributeType > kAttributes
const GrSurfaceProxyView & writeView() const
static const GrUserStencilSettings & kUnused
static constexpr SkIRect MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkRGBA4f FromBytes_RGBA(uint32_t color)
static SkRect MakeIWH(int w, int h)