/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/ #include"include/core/SkPathEffect.h"
Common baseclass for Compose and Sum. This subclass manages two pathEffects, including flattening them. It does nothing in filterPath, and is only useful for managing the lifetimes of its two arguments.
*/ class SkPairPathEffect : public SkPathEffectBase { protected:
SkPairPathEffect(sk_sp<SkPathEffect> pe0, sk_sp<SkPathEffect> pe1)
: fPE0(std::move(pe0)), fPE1(std::move(pe1))
{
SkASSERT(fPE0.get());
SkASSERT(fPE1.get());
}
class SkComposePathEffect : public SkPairPathEffect { public: /** Construct a pathEffect whose effect is to apply first the inner pathEffect and the the outer pathEffect (e.g. outer(inner(path))) The reference counts for outer and inner are both incremented in the constructor, and decremented in the destructor.
*/ static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> outer, sk_sp<SkPathEffect> inner) { if (!outer) { return inner;
} if (!inner) { return outer;
} return sk_sp<SkPathEffect>(new SkComposePathEffect(outer, inner));
}
This subclass of SkPathEffect applies two pathEffects, one after the other. Its filterPath() returns true if either of the effects succeeded.
*/ class SkSumPathEffect : public SkPairPathEffect { public: /** Construct a pathEffect whose effect is to apply two effects, in sequence. (e.g. first(path) + second(path)) The reference counts for first and second are both incremented in the constructor, and decremented in the destructor.
*/ static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> first, sk_sp<SkPathEffect> second) { if (!first) { return second;
} if (!second) { return first;
} return sk_sp<SkPathEffect>(new SkSumPathEffect(first, second));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.