John Stiles | b5ac66c | 2021-07-14 14:04:49 -0400 | [diff] [blame] | 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 | #ifndef RuntimeBlendUtils_DEFINED |
| 9 | #define RuntimeBlendUtils_DEFINED |
| 10 | |
| 11 | #include "include/core/SkBlendMode.h" |
| 12 | #include "include/core/SkRefCnt.h" |
| 13 | |
| 14 | class SkBlender; |
| 15 | |
John Stiles | 126788e | 2021-07-30 11:20:48 -0400 | [diff] [blame] | 16 | /** |
| 17 | * Returns a Runtime Effect-based blender which is equivalent to the passed-in SkBlendMode. |
| 18 | * This should generate the same output as the equivalent SkBlendMode operation, but always uses |
| 19 | * SkSL to perform the blend operation instead of relying on specialized/fixed-function code. |
| 20 | * This is useful for verifying that Runtime Blends are working as expected throughout the pipeline. |
| 21 | */ |
John Stiles | b5ac66c | 2021-07-14 14:04:49 -0400 | [diff] [blame] | 22 | sk_sp<SkBlender> GetRuntimeBlendForBlendMode(SkBlendMode mode); |
| 23 | |
| 24 | #endif |