skia2/modules/svg/include/SkSVGLinearGradient.h
Florin Malita b3418103e9 Reland "[svg] Relocate out of experimental"
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

This reverts commit d6cf56fd34.

TBR=

Change-Id: Ibadd7c8dc0464ec0c27841530ade0c2098305d20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327344
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-10-16 02:32:41 +00:00

44 lines
1.4 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 SkSVGLinearGradient_DEFINED
#define SkSVGLinearGradient_DEFINED
#include "modules/svg/include/SkSVGGradient.h"
#include "modules/svg/include/SkSVGTypes.h"
class SkSVGLinearGradient final : public SkSVGGradient {
public:
~SkSVGLinearGradient() override = default;
static sk_sp<SkSVGLinearGradient> Make() {
return sk_sp<SkSVGLinearGradient>(new SkSVGLinearGradient());
}
void setX1(const SkSVGLength&);
void setY1(const SkSVGLength&);
void setX2(const SkSVGLength&);
void setY2(const SkSVGLength&);
protected:
void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
sk_sp<SkShader> onMakeShader(const SkSVGRenderContext&,
const SkColor*, const SkScalar*, int count,
SkTileMode, const SkMatrix&) const override;
private:
SkSVGLinearGradient();
SkSVGLength fX1 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
SkSVGLength fY1 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
SkSVGLength fX2 = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
SkSVGLength fY2 = SkSVGLength(0 , SkSVGLength::Unit::kPercentage);
using INHERITED = SkSVGGradient;
};
#endif // SkSVGLinearGradient_DEFINED