Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
GrBitmapTextGeoProc Class Reference

#include <GrBitmapTextGeoProc.h>

Inheritance diagram for GrBitmapTextGeoProc:
GrGeometryProcessor GrProcessor

Classes

class  Impl
 

Public Member Functions

 ~GrBitmapTextGeoProc () override
 
const char * name () const override
 
void addNewViews (const GrSurfaceProxyView *, int numActiveViews, GrSamplerState)
 
void addToKey (const GrShaderCaps &caps, skgpu::KeyBuilder *b) const override
 
std::unique_ptr< ProgramImplmakeProgramImpl (const GrShaderCaps &caps) const override
 
- Public Member Functions inherited from GrGeometryProcessor
 GrGeometryProcessor (ClassID)
 
int numTextureSamplers () const
 
const TextureSamplertextureSampler (int index) const
 
int numVertexAttributes () const
 
const AttributeSetvertexAttributes () const
 
int numInstanceAttributes () const
 
const AttributeSetinstanceAttributes () const
 
bool hasVertexAttributes () const
 
bool hasInstanceAttributes () const
 
size_t vertexStride () const
 
size_t instanceStride () const
 
virtual void addToKey (const GrShaderCaps &, skgpu::KeyBuilder *) const =0
 
void getAttributeKey (skgpu::KeyBuilder *b) const
 
virtual std::unique_ptr< ProgramImplmakeProgramImpl (const GrShaderCaps &) const =0
 
- Public Member Functions inherited from GrProcessor
virtual ~GrProcessor ()=default
 
virtual const char * name () const =0
 
void * operator new (size_t size)
 
void * operator new (size_t object_size, size_t footer_size)
 
void operator delete (void *target)
 
void * operator new (size_t size, void *placement)
 
void operator delete (void *target, void *placement)
 
template<typename T >
const Tcast () const
 
ClassID classID () const
 

Static Public Member Functions

static GrGeometryProcessorMake (SkArenaAlloc *arena, const GrShaderCaps &caps, const SkPMColor4f &color, bool wideColor, sk_sp< GrColorSpaceXform > colorSpaceXform, const GrSurfaceProxyView *views, int numActiveViews, GrSamplerState p, skgpu::MaskFormat format, const SkMatrix &localMatrix, bool usesW)
 
- Static Public Member Functions inherited from GrGeometryProcessor
static uint32_t ComputeCoordTransformsKey (const GrFragmentProcessor &fp)
 

Static Public Attributes

static constexpr int kMaxTextures = 4
 
- Static Public Attributes inherited from GrGeometryProcessor
static constexpr int kCoordTransformKeyBits = 4
 

Additional Inherited Members

- Public Types inherited from GrProcessor
enum  ClassID {
  kNull_ClassID , kAttributeTestProcessor_ClassID , kBigKeyProcessor_ClassID , kBlendFragmentProcessor_ClassID ,
  kBlockInputFragmentProcessor_ClassID , kButtCapStrokedCircleGeometryProcessor_ClassID , kCircleGeometryProcessor_ClassID , kCircularRRectEffect_ClassID ,
  kClockwiseTestProcessor_ClassID , kColorTableEffect_ClassID , kCoverageSetOpXP_ClassID , kCustomXP_ClassID ,
  kDashingCircleEffect_ClassID , kDashingLineEffect_ClassID , kDefaultGeoProc_ClassID , kDeviceSpace_ClassID ,
  kDIEllipseGeometryProcessor_ClassID , kDisableColorXP_ClassID , kDrawAtlasPathShader_ClassID , kEllipseGeometryProcessor_ClassID ,
  kEllipticalRRectEffect_ClassID , kFwidthSquircleTestProcessor_ClassID , kGP_ClassID , kGrBicubicEffect_ClassID ,
  kGrBitmapTextGeoProc_ClassID , kGrColorSpaceXformEffect_ClassID , kGrConicEffect_ClassID , kGrConvexPolyEffect_ClassID ,
  kGrDiffuseLightingEffect_ClassID , kGrDisplacementMapEffect_ClassID , kGrDistanceFieldA8TextGeoProc_ClassID , kGrDistanceFieldLCDTextGeoProc_ClassID ,
  kGrDistanceFieldPathGeoProc_ClassID , kGrFillRRectOp_Processor_ClassID , kGrGaussianConvolutionFragmentProcessor_ClassID , kGrMatrixConvolutionEffect_ClassID ,
  kGrMatrixEffect_ClassID , kGrMeshTestProcessor_ClassID , kGrMorphologyEffect_ClassID , kGrPerlinNoise2Effect_ClassID ,
  kGrPipelineDynamicStateTestProcessor_ClassID , kGrQuadEffect_ClassID , kGrRRectShadowGeoProc_ClassID , kGrSkSLFP_ClassID ,
  kGrSpecularLightingEffect_ClassID , kGrTextureEffect_ClassID , kGrUnrolledBinaryGradientColorizer_ClassID , kGrYUVtoRGBEffect_ClassID ,
  kHighPrecisionFragmentProcessor_ClassID , kLatticeGP_ClassID , kPDLCDXferProcessor_ClassID , kPorterDuffXferProcessor_ClassID ,
  kPremulFragmentProcessor_ClassID , kQuadEdgeEffect_ClassID , kQuadPerEdgeAAGeometryProcessor_ClassID , kSeriesFragmentProcessor_ClassID ,
  kShaderPDXferProcessor_ClassID , kSurfaceColorProcessor_ClassID , kSwizzleFragmentProcessor_ClassID , kTessellate_BoundingBoxShader_ClassID ,
  kTessellate_GrModulateAtlasCoverageEffect_ClassID , kTessellate_GrStrokeTessellationShader_ClassID , kTessellate_HullShader_ClassID , kTessellate_MiddleOutShader_ClassID ,
  kTessellate_SimpleTriangleShader_ClassID , kTessellationTestTriShader_ClassID , kTestFP_ClassID , kTestRectOp_ClassID ,
  kVertexColorSpaceBenchGP_ClassID , kVerticesGP_ClassID
}
 
- Protected Member Functions inherited from GrGeometryProcessor
void setVertexAttributes (const Attribute *attrs, int attrCount, size_t stride)
 
void setInstanceAttributes (const Attribute *attrs, int attrCount, size_t stride)
 
void setVertexAttributesWithImplicitOffsets (const Attribute *attrs, int attrCount)
 
void setInstanceAttributesWithImplicitOffsets (const Attribute *attrs, int attrCount)
 
void setTextureSamplerCnt (int cnt)
 
- Protected Member Functions inherited from GrProcessor
 GrProcessor (ClassID classID)
 
 GrProcessor (const GrProcessor &)=delete
 
GrProcessoroperator= (const GrProcessor &)=delete
 
- Static Protected Member Functions inherited from GrGeometryProcessor
static Attribute MakeColorAttribute (const char *name, bool wideColor)
 
- Protected Attributes inherited from GrProcessor
const ClassID fClassID
 

Detailed Description

The output color of this effect is a modulation of the input color and a sample from a texture. It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input coords are a custom attribute.

Definition at line 37 of file GrBitmapTextGeoProc.h.

Constructor & Destructor Documentation

◆ ~GrBitmapTextGeoProc()

GrBitmapTextGeoProc::~GrBitmapTextGeoProc ( )
inlineoverride

Definition at line 59 of file GrBitmapTextGeoProc.h.

59{}

Member Function Documentation

◆ addNewViews()

void GrBitmapTextGeoProc::addNewViews ( const GrSurfaceProxyView views,
int  numActiveViews,
GrSamplerState  params 
)

Definition at line 187 of file GrBitmapTextGeoProc.cpp.

189 {
190 SkASSERT(numActiveViews <= kMaxTextures);
191 // Just to make sure we don't try to add too many proxies
192 numActiveViews = std::min(numActiveViews, kMaxTextures);
193
194 if (!fTextureSamplers[0].isInitialized()) {
195 fAtlasDimensions = views[0].proxy()->dimensions();
196 }
197
198 for (int i = 0; i < numActiveViews; ++i) {
199 const GrSurfaceProxy* proxy = views[i].proxy();
200 SkASSERT(proxy);
201 SkASSERT(proxy->dimensions() == fAtlasDimensions);
202
203 if (!fTextureSamplers[i].isInitialized()) {
204 fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
205 }
206 }
207 this->setTextureSamplerCnt(numActiveViews);
208}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr int kMaxTextures
void reset(GrSamplerState, const GrBackendFormat &, const skgpu::Swizzle &)
void setTextureSamplerCnt(int cnt)
GrSurfaceProxy * proxy() const
const GrBackendFormat & backendFormat() const
SkISize dimensions() const
const EmbeddedViewParams * params
static float min(float r, float g, float b)
Definition: hsl.cpp:48

◆ addToKey()

void GrBitmapTextGeoProc::addToKey ( const GrShaderCaps ,
skgpu::KeyBuilder  
) const
overridevirtual

Adds a key on the skgpu::KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.

Implements GrGeometryProcessor.

Definition at line 210 of file GrBitmapTextGeoProc.cpp.

210 {
211 b->addBool(fUsesW, "usesW");
212 static_assert(static_cast<int>(MaskFormat::kLast) < (1u << 2));
213 b->addBits(2, static_cast<int>(fMaskFormat), "maskFormat");
215 ProgramImpl::ComputeMatrixKey(caps, fLocalMatrix),
216 "localMatrixType");
217 b->add32(this->numTextureSamplers(), "numTextures");
218 b->add32(GrColorSpaceXform::XformKey(fColorSpaceXform.get()), "colorSpaceXform");
219}
static uint32_t XformKey(const GrColorSpaceXform *xform)
static uint32_t ComputeMatrixKey(const GrShaderCaps &caps, const SkMatrix &mat)
T * get() const
Definition: SkRefCnt.h:303
static bool b

◆ Make()

static GrGeometryProcessor * GrBitmapTextGeoProc::Make ( SkArenaAlloc arena,
const GrShaderCaps caps,
const SkPMColor4f color,
bool  wideColor,
sk_sp< GrColorSpaceXform colorSpaceXform,
const GrSurfaceProxyView views,
int  numActiveViews,
GrSamplerState  p,
skgpu::MaskFormat  format,
const SkMatrix localMatrix,
bool  usesW 
)
inlinestatic

Definition at line 41 of file GrBitmapTextGeoProc.h.

51 {
52 return arena->make([&](void* ptr) {
53 return new (ptr) GrBitmapTextGeoProc(caps, color, wideColor, std::move(colorSpaceXform),
54 views, numActiveViews,
55 p, format, localMatrix, usesW);
56 });
57 }
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
Definition: SkArenaAlloc.h:120
DlColor color
uint32_t uint32_t * format

◆ makeProgramImpl()

std::unique_ptr< GrGeometryProcessor::ProgramImpl > GrBitmapTextGeoProc::makeProgramImpl ( const GrShaderCaps ) const
overridevirtual

Returns a new instance of the appropriate implementation class for the given GrGeometryProcessor.

Implements GrGeometryProcessor.

Definition at line 221 of file GrBitmapTextGeoProc.cpp.

222 {
223 return std::make_unique<Impl>();
224}

◆ name()

const char * GrBitmapTextGeoProc::name ( ) const
inlineoverridevirtual

Human-meaningful string to identify this processor; may be embedded in generated shader code and must be a legal SkSL identifier prefix.

Implements GrProcessor.

Definition at line 61 of file GrBitmapTextGeoProc.h.

61{ return "BitmapText"; }

Member Data Documentation

◆ kMaxTextures

constexpr int GrBitmapTextGeoProc::kMaxTextures = 4
inlinestaticconstexpr

Definition at line 39 of file GrBitmapTextGeoProc.h.


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