31#include <initializer_list>
50 for (
int i = 0; i < 3; ++i) {
56 font.setSubpixel(
true);
82 for (
auto twm : {TranslateWithMatrix::kNo, TranslateWithMatrix::kYes}) {
83 for (
auto pm : {PerspMode::kNone, PerspMode::kX, PerspMode::kY, PerspMode::kXY}) {
84 for (
auto& blob : fBlobs) {
85 for (
bool clip : {
false,
true}) {
96 maxH = std::max(
h, maxH);
115 enum class PerspMode { kNone, kX,
kY, kXY };
117 enum class TranslateWithMatrix :
bool {
kNo,
kYes };
120 PerspMode perspMode, TranslateWithMatrix translateWithMatrix) {
124 case PerspMode::kNone:
140 if (TranslateWithMatrix::kYes == translateWithMatrix) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorBLACK
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
void onOnceBeforeDraw() override
SkISize getISize() override
SkString getName() const override
void onDraw(SkCanvas *inputCanvas) override
bool getProps(SkSurfaceProps *props) const
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
SkMatrix getLocalToDeviceAs3x3() const
virtual GrRecordingContext * recordingContext() const
virtual SkISize getBaseLayerSize() const
void setMatrix(const SkM44 &matrix)
void concat(const SkMatrix &matrix)
SkImageInfo imageInfo() const
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
@ kAntiAlias
may have transparent pixels on glyph edges
@ kAlias
no transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
static SkMatrix Translate(SkScalar dx, SkScalar dy)
SkMatrix & setPerspX(SkScalar v)
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
SkMatrix & setPerspY(SkScalar v)
static const SkMatrix & I()
@ kUseDeviceIndependentFonts_Flag
SkPixelGeometry pixelGeometry() const
T & emplace_back(Args &&... args)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static constexpr SkISize Make(int32_t w, int32_t h)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)