Flutter Engine
The Flutter Engine
SkGlyphRunPainter.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkGlyphRunPainter_DEFINED
9#define SkGlyphRunPainter_DEFINED
10
13#include "src/base/SkZip.h"
14
15#include <cstdint>
16
17class SkBitmap;
18class SkCanvas;
19class SkColorSpace;
20class SkGlyph;
21class SkMatrix;
22class SkPaint;
23enum SkColorType : int;
24enum class SkScalerContextFlags : uint32_t;
25namespace sktext { class GlyphRunList; }
26struct SkPoint;
27struct SkRect;
28
30public:
32 public:
35 virtual ~BitmapDevicePainter() = default;
36
38 const SkPaint& paint) const = 0;
39 virtual void drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull,
40 const SkSamplingOptions&, const SkPaint&) const = 0;
41 };
42
45 SkColorSpace* cs);
46
48 SkCanvas* canvas, const BitmapDevicePainter* bitmapDevice,
49 const sktext::GlyphRunList& glyphRunList, const SkPaint& paint,
50 const SkMatrix& drawMatrix);
51private:
52 // The props as on the actual device.
53 const SkSurfaceProps fDeviceProps;
54
55 // The props for when the bitmap device can't draw LCD text.
56 const SkSurfaceProps fBitmapFallbackProps;
57 const SkColorType fColorType;
58 const SkScalerContextFlags fScalerContextFlags;
59};
60#endif // SkGlyphRunPainter_DEFINED
SkColorType
Definition: SkColorType.h:19
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SkScalerContextFlags
virtual void drawBitmap(const SkBitmap &, const SkMatrix &, const SkRect *dstOrNull, const SkSamplingOptions &, const SkPaint &) const =0
virtual void paintMasks(SkZip< const SkGlyph *, SkPoint > accepted, const SkPaint &paint) const =0
BitmapDevicePainter(const BitmapDevicePainter &)=default
void drawForBitmapDevice(SkCanvas *canvas, const BitmapDevicePainter *bitmapDevice, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint, const SkMatrix &drawMatrix)
SkGlyphRunListPainterCPU(const SkSurfaceProps &props, SkColorType colorType, SkColorSpace *cs)
Definition: SkZip.h:25
const Paint & paint
Definition: color_source.cc:38