skia2/include/core/SkBlendMode.h
Cary Clark 4dc5a45405 remove defines and add commas
Preparation for generating bookmaker files for all remaining
interfaces

Standardize enum and enum classes by including a comma after
the last entry.

Replace flatten-related #define in public interfaces
with their equivalent.

The motivation is to give documentation something to refer to.

An alternative would be to move part or all of this out of the
public interface; something I can work on in a follow-up CL.

R=reed@google.com,bsalomon@google.com

Bug: skia:6898
Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0
Reviewed-on: https://skia-review.googlesource.com/129312
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-05-21 17:33:39 +00:00

59 lines
1.5 KiB
C

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBlendMode_DEFINED
#define SkBlendMode_DEFINED
#include "SkTypes.h"
enum class SkBlendMode {
kClear, //!< [0, 0]
kSrc, //!< [Sa, Sc]
kDst, //!< [Da, Dc]
kSrcOver, //!< [Sa + Da * (1 - Sa), Sc + Dc * (1 - Sa)]
kDstOver, //!< [Da + Sa * (1 - Da), Dc + Sc * (1 - Da)]
kSrcIn, //!< [Sa * Da, Sc * Da]
kDstIn, //!< [Da * Sa, Dc * Sa]
kSrcOut, //!< [Sa * (1 - Da), Sc * (1 - Da)]
kDstOut, //!< [Da * (1 - Sa), Dc * (1 - Sa)]
kSrcATop, //!< [Da, Sc * Da + Dc * (1 - Sa)]
kDstATop, //!< [Sa, Dc * Sa + Sc * (1 - Da)]
kXor, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa)]
kPlus, //!< [Sa + Da, Sc + Dc]
kModulate, // 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,
kLastCoeffMode = kScreen,
kOverlay,
kDarken,
kLighten,
kColorDodge,
kColorBurn,
kHardLight,
kSoftLight,
kDifference,
kExclusion,
kMultiply,
kLastSeparableMode = kMultiply,
kHue,
kSaturation,
kColor,
kLuminosity,
kLastMode = kLuminosity,
};
/**
* Return the (c-string) name of the blendmode.
*/
SK_API const char* SkBlendMode_Name(SkBlendMode);
#endif