chromium/third_party/skia/modules/sksg/include/SkSGGeometryEffect.h

/*
 * Copyright 2020 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSGGeometryEffect_DEFINED
#define SkSGGeometryEffect_DEFINED

#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/effects/SkTrimPathEffect.h"
#include "modules/sksg/include/SkSGGeometryNode.h"
#include "modules/sksg/include/SkSGNode.h"
#include "modules/sksg/include/SkSGTransform.h"

#include <utility>
#include <vector>

class SkCanvas;
class SkMatrix;
struct SkPoint;

namespace sksg {
class InvalidationController;

/**
 * Base class for geometry effects.
 */
class GeometryEffect : public GeometryNode {};

/**
 * Apply a trim effect to the child geometry.
 */
class TrimEffect final : public GeometryEffect {};

/**
 * Apply a transform to a GeometryNode.
 */
class GeometryTransform final : public GeometryEffect {};

/**
 * Apply a dash effect to the child geometry.
 *
 * Follows the same semantics as SkDashPathEffect, with one minor tweak: when the number of
 * intervals is odd, they are repeated once more to attain an even sequence (same as SVG
 * stroke-dasharray: https://www.w3.org/TR/SVG11/painting.html#StrokeDasharrayProperty).
 */
class DashEffect final : public GeometryEffect {};

/**
 * Apply a rounded-corner effect to the child geometry.
 */
class RoundEffect final : public GeometryEffect {};

/**
 * Apply an offset effect to the child geometry.
 */
class OffsetEffect final : public GeometryEffect {};

} // namespace sksg

#endif // SkSGGeometryEffect_DEFINED