blob: ab131ee1691861d77c393f91a2132c1ecb49d0d3 [file] [log] [blame]
egdaniel0063a9b2015-01-15 10:52:32 -08001/*
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 GrCustomXfermode_DEFINED
9#define GrCustomXfermode_DEFINED
10
11#include "SkXfermode.h"
12
13class GrFragmentProcessor;
14class GrTexture;
15
16/**
17 * Custom Xfer modes are used for blending when the blend mode cannot be represented using blend
18 * coefficients. It is assumed that all blending is done within the processors' emit code. For each
19 * blend mode there should be a matching fragment processor (used when blending with a background
20 * texture) and xfer processor.
21 */
22namespace GrCustomXfermode {
23 bool IsSupportedMode(SkXfermode::Mode mode);
24
25 GrFragmentProcessor* CreateFP(SkXfermode::Mode mode, GrTexture* background);
egdaniel54f0e9d2015-01-16 06:29:47 -080026
27 GrXPFactory* CreateXPFactory(SkXfermode::Mode mode);
egdaniel0063a9b2015-01-15 10:52:32 -080028};
29
30#endif