Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
GrBitmapTextGeoProc::Impl Class Reference
Inheritance diagram for GrBitmapTextGeoProc::Impl:
GrGeometryProcessor::ProgramImpl

Public Member Functions

void setData (const GrGLSLProgramDataManager &pdman, const GrShaderCaps &shaderCaps, const GrGeometryProcessor &geomProc) override
 
- Public Member Functions inherited from GrGeometryProcessor::ProgramImpl
virtual ~ProgramImpl ()=default
 
std::tuple< FPCoordsMap, GrShaderVaremitCode (EmitArgs &, const GrPipeline &pipeline)
 
void emitTransformCode (GrGLSLVertexBuilder *vb, GrGLSLUniformHandler *uniformHandler)
 
virtual void setData (const GrGLSLProgramDataManager &, const GrShaderCaps &, const GrGeometryProcessor &)=0
 

Additional Inherited Members

- Public Types inherited from GrGeometryProcessor::ProgramImpl
using UniformHandle = GrGLSLProgramDataManager::UniformHandle
 
using SamplerHandle = GrGLSLUniformHandler::SamplerHandle
 
using FPCoordsMap = std::unordered_map< const GrFragmentProcessor *, FPCoords >
 
- Static Public Member Functions inherited from GrGeometryProcessor::ProgramImpl
static uint32_t ComputeMatrixKey (const GrShaderCaps &caps, const SkMatrix &mat)
 
static uint32_t ComputeMatrixKeys (const GrShaderCaps &shaderCaps, const SkMatrix &viewMatrix, const SkMatrix &localMatrix)
 
static uint32_t AddMatrixKeys (const GrShaderCaps &shaderCaps, uint32_t flags, const SkMatrix &viewMatrix, const SkMatrix &localMatrix)
 
- Static Public Attributes inherited from GrGeometryProcessor::ProgramImpl
static constexpr int kMatrixKeyBits = 2
 
- Protected Member Functions inherited from GrGeometryProcessor::ProgramImpl
void setupUniformColor (GrGLSLFPFragmentBuilder *fragBuilder, GrGLSLUniformHandler *uniformHandler, const char *outputName, UniformHandle *colorUniform)
 
- Static Protected Member Functions inherited from GrGeometryProcessor::ProgramImpl
static void SetTransform (const GrGLSLProgramDataManager &, const GrShaderCaps &, const UniformHandle &uniform, const SkMatrix &matrix, SkMatrix *state=nullptr)
 
static void WriteOutputPosition (GrGLSLVertexBuilder *, GrGPArgs *, const char *posName)
 
static void WriteOutputPosition (GrGLSLVertexBuilder *, GrGLSLUniformHandler *, const GrShaderCaps &, GrGPArgs *, const char *posName, const SkMatrix &viewMatrix, UniformHandle *viewMatrixUniform)
 
static void WriteLocalCoord (GrGLSLVertexBuilder *, GrGLSLUniformHandler *, const GrShaderCaps &, GrGPArgs *, GrShaderVar localVar, const SkMatrix &localMatrix, UniformHandle *localMatrixUniform)
 

Detailed Description

Definition at line 38 of file GrBitmapTextGeoProc.cpp.

Member Function Documentation

◆ setData()

void GrBitmapTextGeoProc::Impl::setData ( const GrGLSLProgramDataManager ,
const GrShaderCaps ,
const GrGeometryProcessor  
)
inlineoverridevirtual

A ProgramImpl instance can be reused with any GrGeometryProcessor that produces the same key. This function reads data from a GrGeometryProcessor and updates any uniform variables required by the shaders created in emitCode(). The GrGeometryProcessor parameter is guaranteed to be of the same type and to have an identical processor key as the GrGeometryProcessor that created this ProgramImpl.

Implements GrGeometryProcessor::ProgramImpl.

Definition at line 40 of file GrBitmapTextGeoProc.cpp.

42 {
43 const GrBitmapTextGeoProc& btgp = geomProc.cast<GrBitmapTextGeoProc>();
44 if (btgp.fColor != fColor && !btgp.hasVertexColor()) {
45 pdman.set4fv(fColorUniform, 1, btgp.fColor.vec());
46 fColor = btgp.fColor;
47 }
48
49 const SkISize& atlasDimensions = btgp.fAtlasDimensions;
50 SkASSERT(SkIsPow2(atlasDimensions.fWidth) && SkIsPow2(atlasDimensions.fHeight));
51
52 if (fAtlasDimensions != atlasDimensions) {
53 pdman.set2f(fAtlasDimensionsInvUniform,
54 1.0f / atlasDimensions.fWidth,
55 1.0f / atlasDimensions.fHeight);
56 fAtlasDimensions = atlasDimensions;
57 }
58
59 SetTransform(pdman, shaderCaps, fLocalMatrixUniform, btgp.fLocalMatrix, &fLocalMatrix);
60 fColorSpaceXformHelper.setData(pdman, btgp.fColorSpaceXform.get());
61 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
constexpr bool SkIsPow2(T value)
Definition: SkMath.h:51
void setData(const GrGLSLProgramDataManager &pdman, const GrColorSpaceXform *colorSpaceXform)
static void SetTransform(const GrGLSLProgramDataManager &, const GrShaderCaps &, const UniformHandle &uniform, const SkMatrix &matrix, SkMatrix *state=nullptr)
const T & cast() const
Definition: GrProcessor.h:127
T * get() const
Definition: SkRefCnt.h:303
Definition: SkSize.h:16
int32_t fHeight
Definition: SkSize.h:18
int32_t fWidth
Definition: SkSize.h:17
const float * vec() const
Definition: SkColor.h:308

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