Flutter Engine
The Flutter Engine
SkDraw.h
Go to the documentation of this file.
1
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SkDraw_DEFINED
11#define SkDraw_DEFINED
12
17#include "src/base/SkZip.h"
18#include "src/core/SkDrawBase.h"
19#include <cstddef>
20
21class SkArenaAlloc;
22class SkBitmap;
23class SkBlender;
24class SkDevice;
25class SkGlyph;
27class SkMatrix;
28class SkPaint;
29class SkVertices;
30namespace sktext { class GlyphRunList; }
31struct SkPoint3;
32struct SkPoint;
33struct SkRSXform;
34struct SkRect;
35
36
37// defaults to use SkBlitter::Choose()
38class SkDraw : public SkDrawBase {
39public:
40 SkDraw();
41
42 /* If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. */
43 void drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull,
44 const SkSamplingOptions&, const SkPaint&) const override;
45 void drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const;
46 void drawGlyphRunList(SkCanvas* canvas,
47 SkGlyphRunListPainterCPU* glyphPainter,
48 const sktext::GlyphRunList& glyphRunList,
49 const SkPaint& paint) const;
50
51 void paintMasks(SkZip<const SkGlyph*, SkPoint> accepted, const SkPaint& paint) const override;
52
53 void drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[],
54 const SkPaint&, SkDevice*) const;
55 /* If skipColorXform, skips color conversion when assigning per-vertex colors */
56 void drawVertices(const SkVertices*,
58 const SkPaint&,
59 bool skipColorXform) const;
60 void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count,
62
63#if defined(SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE)
64 void drawDevMask(const SkMask& mask, const SkPaint&) const;
65 void drawBitmapAsMask(const SkBitmap&, const SkSamplingOptions&, const SkPaint&) const;
66#endif
67
68private:
69 void drawFixedVertices(const SkVertices* vertices,
70 sk_sp<SkBlender> blender,
71 const SkPaint& paint,
72 const SkMatrix& ctmInverse,
73 const SkPoint* dev2,
74 const SkPoint3* dev3,
75 SkArenaAlloc* outerAlloc,
76 bool skipColorXform) const;
77};
78
79#endif
int count
Definition: FontMgrTest.cpp:50
uint32_t SkColor
Definition: SkColor.h:37
Definition: SkDraw.h:38
SkDraw()
Definition: SkDraw.cpp:52
void drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[], const SkPaint &, SkDevice *) const
Definition: SkDraw.cpp:237
void drawSprite(const SkBitmap &, int x, int y, const SkPaint &) const
Definition: SkDraw.cpp:376
void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &)
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform) const
void drawGlyphRunList(SkCanvas *canvas, SkGlyphRunListPainterCPU *glyphPainter, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) const
void drawBitmap(const SkBitmap &, const SkMatrix &, const SkRect *dstOrNull, const SkSamplingOptions &, const SkPaint &) const override
Definition: SkDraw.cpp:303
void paintMasks(SkZip< const SkGlyph *, SkPoint > accepted, const SkPaint &paint) const override
Definition: SkDraw_text.cpp:52
Definition: SkZip.h:25
const Paint & paint
Definition: color_source.cc:38
double y
double x
Definition: SkMask.h:25