blob: c8047f8af5f9a557a84617088084a5ac74264299 [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
egdanielf34b2932015-12-01 13:54:06 -080011#include "SkRegion.h"
wangyixcef14bf2015-07-24 13:48:26 -070012#include "SkXfermode.h"
13
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,
bsalomonae4738f2015-09-15 15:33:27 -070022 const char* dstColor, const char* outColor, SkXfermode::Mode 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