Flutter Engine
The Flutter Engine
GrProcessor.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrProcessor_DEFINED
9#define GrProcessor_DEFINED
10
12
13#include <cstddef>
14#include <new>
15
16/** Provides custom shader code to the Ganesh shading pipeline. GrProcessor objects *must* be
17 immutable: after being constructed, their fields may not change.
18
19 Dynamically allocated GrProcessors are managed by a per-thread memory pool. The ref count of an
20 processor must reach 0 before the thread terminates and the pool is destroyed.
21 */
23public:
24 enum ClassID {
25 kNull_ClassID, // Reserved ID for missing (null) processors
26
96 };
97
98 virtual ~GrProcessor() = default;
99
100 /** Human-meaningful string to identify this processor; may be embedded in generated shader
101 code and must be a legal SkSL identifier prefix. */
102 virtual const char* name() const = 0;
103
104 /** Human-readable dump of all information */
105#if defined(GR_TEST_UTILS)
106 virtual SkString onDumpInfo() const { return SkString(); }
107
108 SkString dumpInfo() const {
109 SkString info(name());
110 info.append(this->onDumpInfo());
111 return info;
112 }
113#endif
114
115 void* operator new(size_t size);
116 void* operator new(size_t object_size, size_t footer_size);
117 void operator delete(void* target);
118
119 void* operator new(size_t size, void* placement) {
120 return ::operator new(size, placement);
121 }
122 void operator delete(void* target, void* placement) {
123 ::operator delete(target, placement);
124 }
125
126 /** Helper for down-casting to a GrProcessor subclass */
127 template <typename T> const T& cast() const { return *static_cast<const T*>(this); }
128
129 ClassID classID() const { return fClassID; }
130
131protected:
133 GrProcessor(const GrProcessor&) = delete;
135
137};
138
139#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
GrProcessor(ClassID classID)
Definition: GrProcessor.h:132
ClassID classID() const
Definition: GrProcessor.h:129
const ClassID fClassID
Definition: GrProcessor.h:136
const T & cast() const
Definition: GrProcessor.h:127
GrProcessor & operator=(const GrProcessor &)=delete
GrProcessor(const GrProcessor &)=delete
virtual ~GrProcessor()=default
virtual const char * name() const =0
@ kPorterDuffXferProcessor_ClassID
Definition: GrProcessor.h:77
@ kTessellate_GrModulateAtlasCoverageEffect_ClassID
Definition: GrProcessor.h:86
@ kEllipticalRRectEffect_ClassID
Definition: GrProcessor.h:46
@ kGrMatrixConvolutionEffect_ClassID
Definition: GrProcessor.h:61
@ kCustomXP_ClassID
Definition: GrProcessor.h:37
@ kDeviceSpace_ClassID
Definition: GrProcessor.h:41
@ kDashingLineEffect_ClassID
Definition: GrProcessor.h:39
@ kBlockInputFragmentProcessor_ClassID
Definition: GrProcessor.h:30
@ kShaderPDXferProcessor_ClassID
Definition: GrProcessor.h:82
@ kGrUnrolledBinaryGradientColorizer_ClassID
Definition: GrProcessor.h:72
@ kGrSkSLFP_ClassID
Definition: GrProcessor.h:69
@ kGrDistanceFieldLCDTextGeoProc_ClassID
Definition: GrProcessor.h:57
@ kCircleGeometryProcessor_ClassID
Definition: GrProcessor.h:32
@ kSurfaceColorProcessor_ClassID
Definition: GrProcessor.h:83
@ kTessellate_HullShader_ClassID
Definition: GrProcessor.h:88
@ kBigKeyProcessor_ClassID
Definition: GrProcessor.h:28
@ kGrDisplacementMapEffect_ClassID
Definition: GrProcessor.h:55
@ kGrMatrixEffect_ClassID
Definition: GrProcessor.h:62
@ kGrDistanceFieldA8TextGeoProc_ClassID
Definition: GrProcessor.h:56
@ kPDLCDXferProcessor_ClassID
Definition: GrProcessor.h:76
@ kTessellate_MiddleOutShader_ClassID
Definition: GrProcessor.h:89
@ kFwidthSquircleTestProcessor_ClassID
Definition: GrProcessor.h:47
@ kSeriesFragmentProcessor_ClassID
Definition: GrProcessor.h:81
@ kGrPerlinNoise2Effect_ClassID
Definition: GrProcessor.h:65
@ kTessellate_GrStrokeTessellationShader_ClassID
Definition: GrProcessor.h:87
@ kGrColorSpaceXformEffect_ClassID
Definition: GrProcessor.h:51
@ kCoverageSetOpXP_ClassID
Definition: GrProcessor.h:36
@ kQuadPerEdgeAAGeometryProcessor_ClassID
Definition: GrProcessor.h:80
@ kPremulFragmentProcessor_ClassID
Definition: GrProcessor.h:78
@ kDefaultGeoProc_ClassID
Definition: GrProcessor.h:40
@ kDashingCircleEffect_ClassID
Definition: GrProcessor.h:38
@ kVertexColorSpaceBenchGP_ClassID
Definition: GrProcessor.h:94
@ kGrMorphologyEffect_ClassID
Definition: GrProcessor.h:64
@ kGrDistanceFieldPathGeoProc_ClassID
Definition: GrProcessor.h:58
@ kGrBicubicEffect_ClassID
Definition: GrProcessor.h:49
@ kGrRRectShadowGeoProc_ClassID
Definition: GrProcessor.h:68
@ kGrQuadEffect_ClassID
Definition: GrProcessor.h:67
@ kEllipseGeometryProcessor_ClassID
Definition: GrProcessor.h:45
@ kDisableColorXP_ClassID
Definition: GrProcessor.h:43
@ kGrSpecularLightingEffect_ClassID
Definition: GrProcessor.h:70
@ kHighPrecisionFragmentProcessor_ClassID
Definition: GrProcessor.h:74
@ kTessellate_SimpleTriangleShader_ClassID
Definition: GrProcessor.h:90
@ kGrMeshTestProcessor_ClassID
Definition: GrProcessor.h:63
@ kDrawAtlasPathShader_ClassID
Definition: GrProcessor.h:44
@ kBlendFragmentProcessor_ClassID
Definition: GrProcessor.h:29
@ kQuadEdgeEffect_ClassID
Definition: GrProcessor.h:79
@ kColorTableEffect_ClassID
Definition: GrProcessor.h:35
@ kCircularRRectEffect_ClassID
Definition: GrProcessor.h:33
@ kVerticesGP_ClassID
Definition: GrProcessor.h:95
@ kAttributeTestProcessor_ClassID
Definition: GrProcessor.h:27
@ kGrConvexPolyEffect_ClassID
Definition: GrProcessor.h:53
@ kLatticeGP_ClassID
Definition: GrProcessor.h:75
@ kClockwiseTestProcessor_ClassID
Definition: GrProcessor.h:34
@ kTestRectOp_ClassID
Definition: GrProcessor.h:93
@ kGrGaussianConvolutionFragmentProcessor_ClassID
Definition: GrProcessor.h:60
@ kGrDiffuseLightingEffect_ClassID
Definition: GrProcessor.h:54
@ kGrFillRRectOp_Processor_ClassID
Definition: GrProcessor.h:59
@ kTessellationTestTriShader_ClassID
Definition: GrProcessor.h:91
@ kButtCapStrokedCircleGeometryProcessor_ClassID
Definition: GrProcessor.h:31
@ kGrTextureEffect_ClassID
Definition: GrProcessor.h:71
@ kGrBitmapTextGeoProc_ClassID
Definition: GrProcessor.h:50
@ kSwizzleFragmentProcessor_ClassID
Definition: GrProcessor.h:84
@ kGrYUVtoRGBEffect_ClassID
Definition: GrProcessor.h:73
@ kGrConicEffect_ClassID
Definition: GrProcessor.h:52
@ kDIEllipseGeometryProcessor_ClassID
Definition: GrProcessor.h:42
@ kTessellate_BoundingBoxShader_ClassID
Definition: GrProcessor.h:85
@ kGrPipelineDynamicStateTestProcessor_ClassID
Definition: GrProcessor.h:66
uint32_t * target
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
Definition: switches.h:259
#define T
Definition: precompiler.cc:65