1 Star 0 Fork 345

杜廷佳java/third_party_skia

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
RuntimeBlendUtils.cpp 724 Bytes
一键复制 编辑 原始数据 按行查看 历史
Brian Osman 提交于 2021-09-02 09:26 . Convert internal SkSL to use .eval()
/*
* Copyright 2021 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/core/SkBlendMode.h"
#include "include/core/SkRefCnt.h"
#include "include/effects/SkRuntimeEffect.h"
sk_sp<SkBlender> GetRuntimeBlendForBlendMode(SkBlendMode mode) {
static auto result = SkRuntimeEffect::MakeForBlender(SkString(R"(
uniform blender b;
half4 main(half4 src, half4 dst) {
return b.eval(src, dst);
}
)"));
SkASSERTF(result.effect, "%s", result.errorText.c_str());
SkRuntimeBlendBuilder builder(result.effect);
builder.child("b") = SkBlender::Mode(mode);
return builder.makeBlender();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/du-tingjia-java/third_party_skia.git
[email protected]:du-tingjia-java/third_party_skia.git
du-tingjia-java
third_party_skia
third_party_skia
master

搜索帮助