blob: 092620b7e518649c78a6a2de17823ed197733bde [file] [log] [blame]
wangyixcef14bf2015-07-24 13:48:26 -07001/*
2 * Copyright 2015 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 GrGLBlend_DEFINED
9#define GrGLBlend_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkBlendMode.h"
wangyixcef14bf2015-07-24 13:48:26 -070012
Brian Salomonffd15ea2020-07-01 16:48:20 -040013class GrGLSLShaderBuilder;
wangyixcef14bf2015-07-24 13:48:26 -070014
bsalomonae4738f2015-09-15 15:33:27 -070015namespace GrGLSLBlend {
Brian Salomon87e9ddb2019-12-19 14:50:22 -050016/*
17 * Returns the name of the built in blend function for a SkBlendMode.
Brian Salomon87e9ddb2019-12-19 14:50:22 -050018 */
19const char* BlendFuncName(SkBlendMode mode);
20
21/*
22 * Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor
23 * variables to the outColor variable.
24 */
Brian Salomonffd15ea2020-07-01 16:48:20 -040025void AppendMode(GrGLSLShaderBuilder* fsBuilder,
Brian Salomon87e9ddb2019-12-19 14:50:22 -050026 const char* srcColor,
27 const char* dstColor,
28 const char* outColor,
29 SkBlendMode mode);
John Stilesa6841be2020-08-06 14:11:56 -040030} // namespace GrGLSLBlend
wangyixcef14bf2015-07-24 13:48:26 -070031
32#endif