skia2/experimental/svg/model/SkSVGText.h
Robert Phillips d6cf56fd34 Revert "[svg] Relocate out of experimental"
This reverts commit 6fc4106a9d.

Reason for revert: Blocking the Android roll

Original change's description:
> [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.
>
> Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

TBR=fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

Change-Id: I386cf77a15a9e1d392029804abaf937dae53f435
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327342
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-15 18:54:18 +00:00

58 lines
1.5 KiB
C++

/*
* Copyright 2019 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSVGText_DEFINED
#define SkSVGText_DEFINED
#include "experimental/svg/model/SkSVGShape.h"
#include "experimental/svg/model/SkSVGTypes.h"
#include "include/core/SkFont.h"
#include "include/utils/SkTextUtils.h"
class SkRRect;
class SkSVGText final : public SkSVGShape {
public:
~SkSVGText() override = default;
static sk_sp<SkSVGText> Make() {
return sk_sp<SkSVGText>(new SkSVGText()); }
void setX(const SkSVGLength&);
void setY(const SkSVGLength&);
void setFontFamily(const SkSVGStringType&);
void setFontSize(const SkSVGLength&);
void setFontStyle(const SkSVGStringType&);
void setFontWeight(const SkSVGStringType&);
void setText(const SkSVGStringType&);
void setTextAnchor(const SkSVGStringType&);
protected:
void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
SkPathFillType) const override;
SkPath onAsPath(const SkSVGRenderContext&) const override;
void loadFont();
private:
SkSVGText();
SkSVGLength fX = SkSVGLength(0);
SkSVGLength fY = SkSVGLength(0);
SkSVGStringType fText;
sk_sp<SkTypeface> fTypeface;
SkSVGLength fFontSize;
SkSVGStringType fFontFamily;
SkSVGStringType fFontStyle;
SkSVGStringType fFontWeight;
SkTextUtils::Align fTextAlign = SkTextUtils::Align::kLeft_Align;
using INHERITED = SkSVGShape;
};
#endif // SkSVGText_DEFINED