#include <GrXferProcessor.h>
|
virtual void | emitOutputsForBlendState (const EmitArgs &) |
|
virtual void | emitBlendCodeForDstRead (GrGLSLXPFragmentBuilder *, GrGLSLUniformHandler *, const char *srcColor, const char *srcCoverage, const char *dstColor, const char *outColor, const char *outColorSecondary, const GrXferProcessor &) |
|
virtual void | emitWriteSwizzle (GrGLSLXPFragmentBuilder *, const skgpu::Swizzle &, const char *outColor, const char *outColorSecondary) const |
|
virtual void | onSetData (const GrGLSLProgramDataManager &, const GrXferProcessor &) |
|
Definition at line 282 of file GrXferProcessor.h.
◆ SamplerHandle
◆ ~ProgramImpl()
virtual GrXferProcessor::ProgramImpl::~ProgramImpl |
( |
| ) |
|
|
virtualdefault |
◆ ProgramImpl()
GrXferProcessor::ProgramImpl::ProgramImpl |
( |
| ) |
|
|
protecteddefault |
◆ DefaultCoverageModulation()
void ProgramImpl::DefaultCoverageModulation |
( |
GrGLSLXPFragmentBuilder * |
fragBuilder, |
|
|
const char * |
srcCoverage, |
|
|
const char * |
dstColor, |
|
|
const char * |
outColor, |
|
|
const char * |
outColorSecondary, |
|
|
const GrXferProcessor & |
proc |
|
) |
| |
|
staticprotected |
Definition at line 209 of file GrXferProcessor.cpp.
214 {
215 if (srcCoverage) {
217 fragBuilder->
codeAppendf(
"half3 lerpRGB = mix(%s.aaa, %s.aaa, %s.rgb);",
218 dstColor,
219 outColor,
220 srcCoverage);
221 }
222 fragBuilder->
codeAppendf(
"%s = %s * %s + (half4(1.0) - %s) * %s;",
223 outColor,
224 srcCoverage,
225 outColor,
226 srcCoverage,
227 dstColor);
229 fragBuilder->
codeAppendf(
"%s.a = max(max(lerpRGB.r, lerpRGB.b), lerpRGB.g);", outColor);
230 }
231 }
232}
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
◆ emitBlendCodeForDstRead()
Called by emitCode() when the XP will perform a dst read. This method only needs to supply the blending logic. The base class applies coverage. A subclass only needs to implement this method if it can construct a GrXferProcessor that reads the dst color.
Definition at line 363 of file GrXferProcessor.h.
370 {
371 SK_ABORT(
"emitBlendCodeForDstRead not implemented.");
372 }
#define SK_ABORT(message,...)
◆ emitCode()
void GrXferProcessor::ProgramImpl::emitCode |
( |
const EmitArgs & |
| ) |
|
This is similar to emitCode() in the base class, except it takes a full shader builder. This allows the effect subclass to emit vertex code.
◆ emitOutputsForBlendState()
virtual void GrXferProcessor::ProgramImpl::emitOutputsForBlendState |
( |
const EmitArgs & |
| ) |
|
|
inlineprivatevirtual |
Called by emitCode() when the XP will not be performing a dst read. This method is responsible for both blending and coverage. A subclass only needs to implement this method if it can construct a GrXferProcessor that will not read the dst color.
Definition at line 354 of file GrXferProcessor.h.
354 {
355 SK_ABORT(
"emitOutputsForBlendState not implemented.");
356 }
◆ emitWriteSwizzle()
Definition at line 190 of file GrXferProcessor.cpp.
193 {
195 x->codeAppendf(
"%s = %s.%s;", outColor, outColor, swizzle.
asString().
c_str());
196 if (outColorSecondary) {
197 x->codeAppendf(
"%s = %s.%s;",
198 outColorSecondary,
199 outColorSecondary,
201 }
202 }
203}
const char * c_str() const
SkString asString() const
static constexpr Swizzle RGBA()
◆ onSetData()
◆ setData()
The documentation for this class was generated from the following files: