xref: /third_party/skia/src/gpu/glsl/GrGLSLBlend.h (revision cb93a386)
1/*
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
11#include "include/core/SkBlendMode.h"
12
13class GrGLSLShaderBuilder;
14
15namespace GrGLSLBlend {
16/*
17 * Returns the name of the built in blend function for a SkBlendMode.
18 */
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 */
25void AppendMode(GrGLSLShaderBuilder* fsBuilder,
26                const char* srcColor,
27                const char* dstColor,
28                const char* outColor,
29                SkBlendMode mode);
30}  // namespace GrGLSLBlend
31
32#endif
33