blob: d92f0bb1cb59107309fb444c55c2b42e04cfadee [file] [log] [blame]
John Stilesb5ac66c2021-07-14 14:04:49 -04001/*
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
14class SkBlender;
15
John Stiles126788e2021-07-30 11:20:48 -040016/**
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 Stilesb5ac66c2021-07-14 14:04:49 -040022sk_sp<SkBlender> GetRuntimeBlendForBlendMode(SkBlendMode mode);
23
24#endif