aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkXfermodePriv.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-06-07 23:05:45 -0400
committerGravatar Mike Reed <reed@google.com>2017-06-08 03:57:48 +0000
commitcde9031a5a347a762a3946d216f96542d9cfcef4 (patch)
tree119bfc76106db049801d9b5276bbd8f669482d76 /src/core/SkXfermodePriv.h
parent6162e03cd76aab55da4b579f4d5af72796a280f0 (diff)
remove unused xfermode methods
Bug: skia: Change-Id: Ib0dfa7bbf3d4e73aab355df4d5f5e2a53f653809 Reviewed-on: https://skia-review.googlesource.com/19035 Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkXfermodePriv.h')
-rw-r--r--src/core/SkXfermodePriv.h130
1 files changed, 4 insertions, 126 deletions
diff --git a/src/core/SkXfermodePriv.h b/src/core/SkXfermodePriv.h
index f5cee5a435..425dec24f6 100644
--- a/src/core/SkXfermodePriv.h
+++ b/src/core/SkXfermodePriv.h
@@ -37,99 +37,18 @@ typedef SkPM4f (*SkXfermodeProc4f)(const SkPM4f& src, const SkPM4f& dst);
class SK_API SkXfermode : public SkFlattenable {
public:
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
- const SkAlpha aa[]) const;
-
- /** List of predefined xfermodes.
- The algebra for the modes uses the following symbols:
- Sa, Sc - source alpha and color
- Da, Dc - destination alpha and color (before compositing)
- [a, c] - Resulting (alpha, color) values
- For these equations, the colors are in premultiplied state.
- If no xfermode is specified, kSrcOver is assumed.
- */
- enum Mode {
- kClear_Mode, //!< [0, 0]
- kSrc_Mode, //!< [Sa, Sc]
- kDst_Mode, //!< [Da, Dc]
- kSrcOver_Mode, //!< [Sa + Da * (1 - Sa), Sc + Dc * (1 - Sa)]
- kDstOver_Mode, //!< [Da + Sa * (1 - Da), Dc + Sc * (1 - Da)]
- kSrcIn_Mode, //!< [Sa * Da, Sc * Da]
- kDstIn_Mode, //!< [Da * Sa, Dc * Sa]
- kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)]
- kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)]
- kSrcATop_Mode, //!< [Da, Sc * Da + Dc * (1 - Sa)]
- kDstATop_Mode, //!< [Sa, Dc * Sa + Sc * (1 - Da)]
- kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa)]
- kPlus_Mode, //!< [Sa + Da, Sc + Dc]
- kModulate_Mode, // multiplies all components (= alpha and color)
-
- // Following blend modes are defined in the CSS Compositing standard:
- // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending
- kScreen_Mode,
- kLastCoeffMode = kScreen_Mode,
-
- kOverlay_Mode,
- kDarken_Mode,
- kLighten_Mode,
- kColorDodge_Mode,
- kColorBurn_Mode,
- kHardLight_Mode,
- kSoftLight_Mode,
- kDifference_Mode,
- kExclusion_Mode,
- kMultiply_Mode,
- kLastSeparableMode = kMultiply_Mode,
-
- kHue_Mode,
- kSaturation_Mode,
- kColor_Mode,
- kLuminosity_Mode,
- kLastMode = kLuminosity_Mode
- };
-
- /**
- * Gets the name of the Mode as a string.
- */
- static const char* ModeName(Mode);
- static const char* ModeName(SkBlendMode mode) {
- return ModeName(Mode(mode));
- }
+ const SkAlpha aa[]) const = 0;
/**
* If the xfermode is one of the modes in the Mode enum, then asMode()
* returns true and sets (if not null) mode accordingly. Otherwise it
* returns false and ignores the mode parameter.
*/
- virtual bool asMode(Mode* mode) const;
-
- /**
- * The same as calling xfermode->asMode(mode), except that this also checks
- * if the xfermode is NULL, and if so, treats it as kSrcOver_Mode.
- */
- static bool AsMode(const SkXfermode*, Mode* mode);
- static bool AsMode(const sk_sp<SkXfermode>& xfer, Mode* mode) {
- return AsMode(xfer.get(), mode);
- }
-
- /**
- * Returns true if the xfermode claims to be the specified Mode. This works
- * correctly even if the xfermode is NULL (which equates to kSrcOver.) Thus
- * you can say this without checking for a null...
- *
- * If (SkXfermode::IsMode(paint.getXfermode(),
- * SkXfermode::kDstOver_Mode)) {
- * ...
- * }
- */
- static bool IsMode(const SkXfermode* xfer, Mode mode);
- static bool IsMode(const sk_sp<SkXfermode>& xfer, Mode mode) {
- return IsMode(xfer.get(), mode);
- }
+ virtual bool asMode(SkBlendMode* mode) const;
/** Return an SkXfermode object for the specified mode.
*/
static sk_sp<SkXfermode> Make(SkBlendMode);
- static sk_sp<SkXfermode> Make(Mode m) { return Make((SkBlendMode)m); }
/**
* Skia maintains global xfermode objects corresponding to each BlendMode. This returns a
@@ -147,28 +66,14 @@ public:
}
SkBlendMode blend() const {
- Mode mode;
+ SkBlendMode mode;
SkAssertResult(this->asMode(&mode));
- return (SkBlendMode)mode;
+ return mode;
}
static SkXfermodeProc GetProc(SkBlendMode);
static SkXfermodeProc4f GetProc4f(SkBlendMode);
- /**
- * Returns whether or not the xfer mode can support treating coverage as alpha
- */
- virtual bool supportsCoverageAsAlpha() const;
-
- /**
- * The same as calling xfermode->supportsCoverageAsAlpha(), except that this also checks if
- * the xfermode is NULL, and if so, treats it as kSrcOver_Mode.
- */
- static bool SupportsCoverageAsAlpha(const SkXfermode* xfer);
- static bool SupportsCoverageAsAlpha(const sk_sp<SkXfermode>& xfer) {
- return SupportsCoverageAsAlpha(xfer.get());
- }
-
enum SrcColorOpacity {
// The src color is known to be opaque (alpha == 255)
kOpaque_SrcColorOpacity = 0,
@@ -180,21 +85,6 @@ public:
kUnknown_SrcColorOpacity = 3
};
- /**
- * Returns whether or not the result of the draw with the xfer mode will be opaque or not. The
- * input to this call is an enum describing known information about the opacity of the src color
- * that will be given to the xfer mode.
- */
- virtual bool isOpaque(SrcColorOpacity opacityType) const;
-
- /**
- * The same as calling xfermode->isOpaque(...), except that this also checks if
- * the xfermode is NULL, and if so, treats it as kSrcOver_Mode.
- */
- static bool IsOpaque(const SkXfermode* xfer, SrcColorOpacity opacityType);
- static bool IsOpaque(const sk_sp<SkXfermode>& xfer, SrcColorOpacity opacityType) {
- return IsOpaque(xfer.get(), opacityType);
- }
static bool IsOpaque(SkBlendMode, SrcColorOpacity);
#if SK_SUPPORT_GPU
@@ -249,20 +139,8 @@ public:
protected:
SkXfermode() {}
- /** The default implementation of xfer32/xfer16/xferA8 in turn call this
- method, 1 color at a time (upscaled to a SkPMColor). The default
- implementation of this method just returns dst. If performance is
- important, your subclass should override xfer32/xfer16/xferA8 directly.
-
- This method will not be called directly by the client, so it need not
- be implemented if your subclass has overridden xfer32/xfer16/xferA8
- */
- virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const;
private:
- enum {
- kModeCount = kLastMode + 1
- };
typedef SkFlattenable INHERITED;
};