skia2/include/core/SkBlender.h
Mike Reed a8ac441411 Move Mode() factory into SkBlender
This frees the SkBlenders names for optional effects, and better
reflects the fact that the "core" relies on this Mode() factory.

... and makes this clearer:
https://skia-review.googlesource.com/c/skia/+/424417

Maybe this isn't important. I see SkShaders is in core header, but
SkImageFilters is in effects, so I guess we don't have a consistent
notion for this naming yet. What I do think is semi-important is
that core headers include effects that core uses, so in this case
a Mode() factory does make sense to be in a core header, just have to
decide/bikeshed how to scope it.

Change-Id: I94da47cfaa6c1ea22894bf66a48604d3722b4062
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424416
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-06 13:39:05 +00:00

34 lines
856 B
C++

/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBlender_DEFINED
#define SkBlender_DEFINED
#include "include/core/SkBlendMode.h"
#include "include/core/SkFlattenable.h"
/**
* SkBlender represents a custom blend function in the Skia pipeline. When an SkBlender is
* present in a paint, the SkBlendMode is ignored. A blender combines a source color (the
* result of our paint) and destination color (from the canvas) into a final color.
*/
class SK_API SkBlender : public SkFlattenable {
public:
/**
* Create a blender that implements the specified BlendMode.
*/
static sk_sp<SkBlender> Mode(SkBlendMode mode);
private:
SkBlender() = default;
friend class SkBlenderBase;
using INHERITED = SkFlattenable;
};
#endif