Flutter Engine
The Flutter Engine
Functions
RuntimeBlendUtils.h File Reference
#include "include/core/SkBlendMode.h"
#include "include/core/SkRefCnt.h"

Go to the source code of this file.

Functions

sk_sp< SkBlenderGetRuntimeBlendForBlendMode (SkBlendMode mode)
 

Function Documentation

◆ GetRuntimeBlendForBlendMode()

sk_sp< SkBlender > GetRuntimeBlendForBlendMode ( SkBlendMode  mode)

Returns a Runtime Effect-based blender which is equivalent to the passed-in SkBlendMode. This should generate the same output as the equivalent SkBlendMode operation, but always uses SkSL to perform the blend operation instead of relying on specialized/fixed-function code. This is useful for verifying that Runtime Blends are working as expected throughout the pipeline.

Definition at line 13 of file RuntimeBlendUtils.cpp.

13 {
15 uniform blender b;
16 half4 main(half4 src, half4 dst) {
17 return b.eval(src, dst);
18 }
19 )"));
20
21 SkASSERTF(result.effect, "%s", result.errorText.c_str());
22
24 builder.child("b") = SkBlender::Mode(mode);
25 return builder.makeBlender();
26}
#define SkASSERTF(cond, fmt,...)
Definition: SkAssert.h:117
static sk_sp< SkBlender > Mode(SkBlendMode mode)
static Result MakeForBlender(SkString sksl, const Options &)
GAsyncResult * result
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228