blob: d090e74b57dc8c11443a1cdfac8826d869a5c256 [file] [log] [blame]
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrGLBlend_DEFINED
#define GrGLBlend_DEFINED
#include "include/core/SkBlendMode.h"
class GrGLSLFragmentBuilder;
namespace GrGLSLBlend {
/*
* Returns the name of the built in blend function for a SkBlendMode.
* When and if the SkSL compiler supports inlining it'd be simpler to just call
* blend(mode, src, dst) where mode is a literal when the desired blend mode is
* not variable.
*/
const char* BlendFuncName(SkBlendMode mode);
/*
* Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor
* variables to the outColor variable.
*/
void AppendMode(GrGLSLFragmentBuilder* fsBuilder,
const char* srcColor,
const char* dstColor,
const char* outColor,
SkBlendMode mode);
};
#endif