Flutter Engine
The Flutter Engine
|
#include <GrGeometryProcessor.h>
Classes | |
struct | EmitArgs |
struct | FPCoords |
struct | GrGPArgs |
Public Types | |
using | UniformHandle = GrGLSLProgramDataManager::UniformHandle |
using | SamplerHandle = GrGLSLUniformHandler::SamplerHandle |
using | FPCoordsMap = std::unordered_map< const GrFragmentProcessor *, FPCoords > |
Public Member Functions | |
virtual | ~ProgramImpl ()=default |
std::tuple< FPCoordsMap, GrShaderVar > | emitCode (EmitArgs &, const GrPipeline &pipeline) |
void | emitTransformCode (GrGLSLVertexBuilder *vb, GrGLSLUniformHandler *uniformHandler) |
virtual void | setData (const GrGLSLProgramDataManager &, const GrShaderCaps &, const GrGeometryProcessor &)=0 |
Static Public Member Functions | |
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 | |
static constexpr int | kMatrixKeyBits = 2 |
Protected Member Functions | |
void | setupUniformColor (GrGLSLFPFragmentBuilder *fragBuilder, GrGLSLUniformHandler *uniformHandler, const char *outputName, UniformHandle *colorUniform) |
Static Protected Member Functions | |
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) |
Private Member Functions | |
virtual void | onEmitCode (EmitArgs &, GrGPArgs *)=0 |
Definition at line 261 of file GrGeometryProcessor.h.
using GrGeometryProcessor::ProgramImpl::FPCoordsMap = std::unordered_map<const GrFragmentProcessor*, FPCoords> |
Definition at line 271 of file GrGeometryProcessor.h.
using GrGeometryProcessor::ProgramImpl::SamplerHandle = GrGLSLUniformHandler::SamplerHandle |
Definition at line 264 of file GrGeometryProcessor.h.
using GrGeometryProcessor::ProgramImpl::UniformHandle = GrGLSLProgramDataManager::UniformHandle |
Definition at line 263 of file GrGeometryProcessor.h.
|
virtualdefault |
|
inlinestatic |
Definition at line 357 of file GrGeometryProcessor.h.
|
inlinestatic |
Definition at line 335 of file GrGeometryProcessor.h.
|
inlinestatic |
Definition at line 350 of file GrGeometryProcessor.h.
std::tuple< FPCoordsMap, GrShaderVar > GrGeometryProcessor::ProgramImpl::emitCode | ( | EmitArgs & | , |
const GrPipeline & | pipeline | ||
) |
Emits the code from this geometry processor into the shaders. For any FP in the pipeline that has its input coords implemented by the GP as a varying, the varying will be accessible in the returned map and should be used when the FP code is emitted. The FS variable containing the GP's output local coords is also returned.
void ProgramImpl::emitTransformCode | ( | GrGLSLVertexBuilder * | vb, |
GrGLSLUniformHandler * | uniformHandler | ||
) |
Called after all effect emitCode() functions, to give the processor a chance to write out additional transformation code now that all uniforms have been emitted. It generates the final code for assigning transformed coordinates to the varyings recorded in the call to collectTransforms(). This must happen after FP code emission so that it has access to any uniforms the FPs registered for uniform sample matrix invocations.
Definition at line 237 of file GrGeometryProcessor.cpp.
|
privatepure virtual |
|
pure virtual |
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.
Implemented in GrRRectShadowGeoProc::Impl, GrConicEffect::Impl, GrQuadEffect::Impl, GrBitmapTextGeoProc::Impl, GrDistanceFieldA8TextGeoProc::Impl, GrDistanceFieldPathGeoProc::Impl, and GrDistanceFieldLCDTextGeoProc::Impl.
|
staticprotected |
Definition at line 340 of file GrGeometryProcessor.cpp.
|
protected |
Definition at line 323 of file GrGeometryProcessor.cpp.
|
staticprotected |
Definition at line 474 of file GrGeometryProcessor.cpp.
|
staticprotected |
|
staticprotected |
|
inlinestaticconstexpr |
Definition at line 366 of file GrGeometryProcessor.h.