blob: fb0fb0b9353ea077dc0371238e0f5b18ab6a322a [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 Reed0e39f972016-11-23 22:16:59 +000011#include "SkBlendMode.h"
egdanielf34b2932015-12-01 13:54:06 -080012#include "SkRegion.h"
wangyixcef14bf2015-07-24 13:48:26 -070013
egdaniel2d721d32015-11-11 13:06:05 -080014class GrGLSLFragmentBuilder;
wangyixcef14bf2015-07-24 13:48:26 -070015
bsalomonae4738f2015-09-15 15:33:27 -070016namespace GrGLSLBlend {
wangyixcef14bf2015-07-24 13:48:26 -070017 /*
18 * Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor
19 * variables to the outColor variable.
20 */
egdaniel2d721d32015-11-11 13:06:05 -080021 void AppendMode(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor,
Mike Reed7d954ad2016-10-28 15:42:34 -040022 const char* dstColor, const char* outColor, SkBlendMode mode);
egdanielf34b2932015-12-01 13:54:06 -080023
24 void AppendRegionOp(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor,
25 const char* dstColor, const char* outColor, SkRegion::Op regionOp);
wangyixcef14bf2015-07-24 13:48:26 -070026};
27
28#endif