#include "include/utils/SkShadowUtils.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkBlender.h"
#include "include/core/SkBlurTypes.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkVertices.h"
#include "include/private/SkIDChangeListener.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkRandom.h"
#include "src/core/SkBlurMask.h"
#include "src/core/SkColorFilterPriv.h"
#include "src/core/SkDevice.h"
#include "src/core/SkDrawShadowInfo.h"
#include "src/core/SkPathPriv.h"
#include "src/core/SkResourceCache.h"
#include "src/core/SkVerticesPriv.h"
#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
#include "src/utils/SkShadowTessellator.h"
#endif
#if defined(SK_GANESH)
#include "src/gpu/ganesh/GrStyle.h"
#include "src/gpu/ganesh/geometry/GrStyledShape.h"
#endif
#include <algorithm>
#include <cstring>
#include <functional>
#include <memory>
#include <new>
#include <utility>
usingnamespaceskia_private;
class SkRRect;
#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
namespace {
uint64_t resource_cache_shared_id() { … }
struct AmbientVerticesFactory { … };
struct SpotVerticesFactory { … };
class CachedTessellations : public SkRefCnt { … };
class CachedTessellationsRec : public SkResourceCache::Rec { … };
template <typename FACTORY>
struct FindContext { … };
template <typename FACTORY>
bool FindVisitor(const SkResourceCache::Rec& baseRec, void* ctx) { … }
class ShadowedPath { … };
static void* kNamespace;
class ShadowInvalidator : public SkIDChangeListener { … };
template <typename FACTORY>
bool draw_shadow(const FACTORY& factory,
std::function<void(const SkVertices*, SkBlendMode, const SkPaint&,
SkScalar tx, SkScalar ty, bool)> drawProc, ShadowedPath& path, SkColor color) { … }
}
static bool tilted(const SkPoint3& zPlaneParams) { … }
#endif
void SkShadowUtils::ComputeTonalColors(SkColor inAmbientColor, SkColor inSpotColor,
SkColor* outAmbientColor, SkColor* outSpotColor) { … }
static bool fill_shadow_rec(const SkPath& path, const SkPoint3& zPlaneParams,
const SkPoint3& lightPos, SkScalar lightRadius,
SkColor ambientColor, SkColor spotColor,
uint32_t flags, const SkMatrix& ctm, SkDrawShadowRec* rec) { … }
void SkShadowUtils::DrawShadow(SkCanvas* canvas, const SkPath& path, const SkPoint3& zPlaneParams,
const SkPoint3& lightPos, SkScalar lightRadius,
SkColor ambientColor, SkColor spotColor,
uint32_t flags) { … }
bool SkShadowUtils::GetLocalBounds(const SkMatrix& ctm, const SkPath& path,
const SkPoint3& zPlaneParams, const SkPoint3& lightPos,
SkScalar lightRadius, uint32_t flags, SkRect* bounds) { … }
static bool validate_rec(const SkDrawShadowRec& rec) { … }
void SkDevice::drawShadow(const SkPath& path, const SkDrawShadowRec& rec) { … }