Flutter Engine
The Flutter Engine
Macros | Functions
SkPaint.cpp File Reference
#include "include/core/SkPaint.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkBlender.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPathEffect.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkStrokeRec.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTo.h"
#include "src/core/SkBlenderBase.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkColorSpaceXformSteps.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkPaintDefaults.h"
#include "src/core/SkPathEffectBase.h"
#include "src/effects/colorfilters/SkColorFilterBase.h"
#include <utility>

Go to the source code of this file.

Macros

#define EQUAL(field)   (a.field == b.field)
 
#define DEFINE_FIELD_REF(type)    sk_sp<Sk##type> SkPaint::ref##type() const { return f##type; }
 
#define DEFINE_FIELD_SET(Field)    void SkPaint::set##Field(sk_sp<Sk##Field> f) { f##Field = std::move(f); }
 

Functions

bool operator== (const SkPaint &a, const SkPaint &b)
 
static bool affects_alpha (const SkColorFilter *cf)
 
static bool affects_alpha (const SkImageFilter *imf)
 

Macro Definition Documentation

◆ DEFINE_FIELD_REF

#define DEFINE_FIELD_REF (   type)     sk_sp<Sk##type> SkPaint::ref##type() const { return f##type; }

Definition at line 82 of file SkPaint.cpp.

◆ DEFINE_FIELD_SET

#define DEFINE_FIELD_SET (   Field)     void SkPaint::set##Field(sk_sp<Sk##Field> f) { f##Field = std::move(f); }

Definition at line 92 of file SkPaint.cpp.

◆ EQUAL

#define EQUAL (   field)    (a.field == b.field)

Function Documentation

◆ affects_alpha() [1/2]

static bool affects_alpha ( const SkColorFilter cf)
static

Definition at line 262 of file SkPaint.cpp.

262 {
263 return cf && !as_CFB(cf)->isAlphaUnchanged();
264}
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
bool isAlphaUnchanged() const

◆ affects_alpha() [2/2]

static bool affects_alpha ( const SkImageFilter imf)
static

Definition at line 267 of file SkPaint.cpp.

267 {
268 // TODO: check if we should allow imagefilters to broadcast that they don't affect alpha
269 // ala colorfilters
270 return imf != nullptr;
271}

◆ operator==()

bool operator== ( const SkPaint a,
const SkPaint b 
)

Compares a and b, and returns true if a and b are equivalent. May return false if SkPathEffect, SkShader, SkMaskFilter, SkColorFilter, or SkImageFilter have identical contents but different pointers.

Parameters
aSkPaint to compare
bSkPaint to compare
Returns
true if SkPaint pair are equivalent

Definition at line 66 of file SkPaint.cpp.

66 {
67#define EQUAL(field) (a.field == b.field)
68 return EQUAL(fPathEffect)
69 && EQUAL(fShader)
70 && EQUAL(fMaskFilter)
71 && EQUAL(fColorFilter)
72 && EQUAL(fBlender)
73 && EQUAL(fImageFilter)
74 && EQUAL(fColor4f)
75 && EQUAL(fWidth)
77 && EQUAL(fBitfieldsUInt)
78 ;
79#undef EQUAL
80}
#define EQUAL(field)