Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tools
RuntimeBlendUtils.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2021 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
include/core/SkBlendMode.h
"
9
#include "
include/core/SkRefCnt.h
"
10
#include "
include/effects/SkRuntimeEffect.h
"
11
#include "
tools/RuntimeBlendUtils.h
"
12
13
sk_sp<SkBlender>
GetRuntimeBlendForBlendMode
(
SkBlendMode
mode) {
14
static
auto
result
=
SkRuntimeEffect::MakeForBlender
(
SkString
(R
"(
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
23
SkRuntimeBlendBuilder
builder(
result
.effect);
24
builder.child(
"b"
) =
SkBlender::Mode
(mode);
25
return
builder.makeBlender();
26
}
GetRuntimeBlendForBlendMode
sk_sp< SkBlender > GetRuntimeBlendForBlendMode(SkBlendMode mode)
Definition
RuntimeBlendUtils.cpp:13
RuntimeBlendUtils.h
SkASSERTF
#define SkASSERTF(cond, fmt,...)
Definition
SkAssert.h:117
SkBlendMode.h
SkBlendMode
SkBlendMode
Definition
SkBlendMode.h:38
SkRefCnt.h
SkRuntimeEffect.h
SkBlender::Mode
static sk_sp< SkBlender > Mode(SkBlendMode mode)
Definition
SkBlendModeBlender.cpp:20
SkRuntimeBlendBuilder
Definition
SkRuntimeEffect.h:506
SkRuntimeEffect::MakeForBlender
static Result MakeForBlender(SkString sksl, const Options &)
Definition
SkRuntimeEffect.cpp:672
SkString
Definition
SkString.h:118
sk_sp
Definition
SkRefCnt.h:220
result
GAsyncResult * result
Definition
fl_text_input_plugin.cc:106
Generated on Fri Apr 26 2024 06:18:11 for Flutter Engine by
1.9.8