Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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