/src/skia/tools/RuntimeBlendUtils.cpp
Line | Count | Source (jump to first uncovered line) |
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 | 0 | sk_sp<SkBlender> GetRuntimeBlendForBlendMode(SkBlendMode mode) { |
14 | 0 | static auto result = SkRuntimeEffect::MakeForBlender(SkString(R"( |
15 | 0 | uniform blender b; |
16 | 0 | half4 main(half4 src, half4 dst) { |
17 | 0 | return b.eval(src, dst); |
18 | 0 | } |
19 | 0 | )")); |
20 | |
|
21 | 0 | SkASSERTF(result.effect, "%s", result.errorText.c_str()); |
22 | |
|
23 | 0 | SkRuntimeBlendBuilder builder(result.effect); |
24 | 0 | builder.child("b") = SkBlender::Mode(mode); |
25 | 0 | return builder.makeBlender(); |
26 | 0 | } Unexecuted instantiation: GetRuntimeBlendForBlendMode(SkBlendMode) Unexecuted instantiation: GetRuntimeBlendForBlendMode(SkBlendMode) |