wangyix | cef14bf | 2015-07-24 13:48:26 -0700 | [diff] [blame] | 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 | |
Mike Reed | 0e39f97 | 2016-11-23 22:16:59 +0000 | [diff] [blame] | 11 | #include "SkBlendMode.h" |
egdaniel | f34b293 | 2015-12-01 13:54:06 -0800 | [diff] [blame] | 12 | #include "SkRegion.h" |
wangyix | cef14bf | 2015-07-24 13:48:26 -0700 | [diff] [blame] | 13 | |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 14 | class GrGLSLFragmentBuilder; |
wangyix | cef14bf | 2015-07-24 13:48:26 -0700 | [diff] [blame] | 15 | |
bsalomon | ae4738f | 2015-09-15 15:33:27 -0700 | [diff] [blame] | 16 | namespace GrGLSLBlend { |
wangyix | cef14bf | 2015-07-24 13:48:26 -0700 | [diff] [blame] | 17 | /* |
| 18 | * Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor |
| 19 | * variables to the outColor variable. |
| 20 | */ |
egdaniel | 2d721d3 | 2015-11-11 13:06:05 -0800 | [diff] [blame] | 21 | void AppendMode(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor, |
Mike Reed | 7d954ad | 2016-10-28 15:42:34 -0400 | [diff] [blame] | 22 | const char* dstColor, const char* outColor, SkBlendMode mode); |
egdaniel | f34b293 | 2015-12-01 13:54:06 -0800 | [diff] [blame] | 23 | |
| 24 | void AppendRegionOp(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor, |
| 25 | const char* dstColor, const char* outColor, SkRegion::Op regionOp); |
wangyix | cef14bf | 2015-07-24 13:48:26 -0700 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | #endif |