Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrBlendFragmentProcessor Namespace Reference

Functions

std::unique_ptr< GrFragmentProcessorMake (std::unique_ptr< GrFragmentProcessor > src, std::unique_ptr< GrFragmentProcessor > dst, SkBlendMode mode, bool shareBlendLogic=true)
 
template<SkBlendMode mode>
std::unique_ptr< GrFragmentProcessorMake (std::unique_ptr< GrFragmentProcessor > src, std::unique_ptr< GrFragmentProcessor > dst)
 

Function Documentation

◆ Make() [1/2]

template<SkBlendMode mode>
std::unique_ptr< GrFragmentProcessor > GrBlendFragmentProcessor::Make ( std::unique_ptr< GrFragmentProcessor src,
std::unique_ptr< GrFragmentProcessor dst 
)

Blends src and dst inputs according to the blend mode. If either input is null, fInputColor is used instead. Hard-wires a single blend mode into the code (slightly reducing complexity).

Definition at line 36 of file GrBlendFragmentProcessor.h.

37 {
38 return Make(std::move(src), std::move(dst), mode, /*shareBlendLogic=*/false);
39}
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)

◆ Make() [2/2]

std::unique_ptr< GrFragmentProcessor > GrBlendFragmentProcessor::Make ( std::unique_ptr< GrFragmentProcessor src,
std::unique_ptr< GrFragmentProcessor dst,
SkBlendMode  mode,
bool  shareBlendLogic = true 
)

Blends src and dst inputs according to the blend mode. If either input is null, fInputColor is used instead.

  • When shareBlendLogic is false, the blend function logic is written directly into the code.
  • When shareBlendLogic is true, most Porter-Duff blends share the same code, and a uniform is used to pick the blend type. This can reduce our overall shader count.

Definition at line 272 of file GrBlendFragmentProcessor.cpp.

276 {
277 // These modes simplify dramatically in the shader, but only if we bypass the shared logic:
278 if (mode == SkBlendMode::kClear || mode == SkBlendMode::kSrc || mode == SkBlendMode::kDst) {
279 shareBlendLogic = false;
280 }
281
282 return BlendFragmentProcessor::Make(std::move(src), std::move(dst), mode, shareBlendLogic);
283}
@ kClear
r = 0
static std::unique_ptr< GrFragmentProcessor > Make(std::unique_ptr< GrFragmentProcessor > src, std::unique_ptr< GrFragmentProcessor > dst, SkBlendMode mode, bool shareBlendLogic)