2015-09-09 19:58:32 +00:00
|
|
|
/*
|
|
|
|
* 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 GrXfermodeFragmentProcessor_DEFINED
|
|
|
|
#define GrXfermodeFragmentProcessor_DEFINED
|
|
|
|
|
2016-10-28 19:42:34 +00:00
|
|
|
#include "SkRefCnt.h"
|
|
|
|
#include "SkBlendMode.h"
|
2015-09-09 19:58:32 +00:00
|
|
|
|
|
|
|
class GrFragmentProcessor;
|
|
|
|
|
|
|
|
namespace GrXfermodeFragmentProcessor {
|
2015-09-15 22:33:27 +00:00
|
|
|
/** The color input to the returned processor is treated as the src and the passed in processor
|
|
|
|
is the dst. */
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> MakeFromDstProcessor(sk_sp<GrFragmentProcessor> dst,
|
2016-10-28 19:42:34 +00:00
|
|
|
SkBlendMode mode);
|
2015-09-15 22:33:27 +00:00
|
|
|
|
|
|
|
/** The color input to the returned processor is treated as the dst and the passed in processor
|
|
|
|
is the src. */
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> MakeFromSrcProcessor(sk_sp<GrFragmentProcessor> src,
|
2016-10-28 19:42:34 +00:00
|
|
|
SkBlendMode mode);
|
2015-09-15 22:33:27 +00:00
|
|
|
|
2015-09-28 13:26:28 +00:00
|
|
|
/** Takes the input color, which is assumed to be unpremultiplied, passes it as an opaque color
|
|
|
|
to both src and dst. The outputs of a src and dst are blended using mode and the original
|
|
|
|
input's alpha is applied to the blended color to produce a premul output. */
|
2016-06-09 15:01:03 +00:00
|
|
|
sk_sp<GrFragmentProcessor> MakeFromTwoProcessors(sk_sp<GrFragmentProcessor> src,
|
|
|
|
sk_sp<GrFragmentProcessor> dst,
|
2016-10-28 19:42:34 +00:00
|
|
|
SkBlendMode mode);
|
2015-09-09 19:58:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|