| 1 |
/* |
| 2 |
* Copyright 2023 Google LLC |
| 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 SkBlitter_A8_DEFINED |
| 9 |
#define SkBlitter_A8_DEFINED |
| 10 |
|
| 11 |
#include "include/core/SkColor.h" |
| 12 |
#include "include/core/SkPixmap.h" |
| 13 |
#include "include/core/SkRefCnt.h" |
| 14 |
#include "src/core/SkBlitter.h" |
| 15 |
|
| 16 |
#include <cstdint> |
| 17 |
|
| 18 |
class SkArenaAlloc; |
| 19 |
class SkMatrix; |
| 20 |
class SkPaint; |
| 21 |
class SkShader; |
| 22 |
class SkSurfaceProps; |
| 23 |
struct SkIRect; |
| 24 |
struct SkMask; |
| 25 |
enum class SkDrawCoverage : bool; |
| 26 |
|
| 27 |
class SkA8_Coverage_Blitter : public SkBlitter { |
| 28 |
public: |
| 29 |
SkA8_Coverage_Blitter(const SkPixmap& device, const SkPaint& paint); |
| 30 |
void blitH(int x, int y, int width) override; |
| 31 |
void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override; |
| 32 |
void blitV(int x, int y, int height, SkAlpha alpha) override; |
| 33 |
void blitRect(int x, int y, int width, int height) override; |
| 34 |
void blitMask(const SkMask&, const SkIRect&) override; |
| 35 |
|
| 36 |
private: |
| 37 |
const SkPixmap fDevice; |
| 38 |
}; |
| 39 |
|
| 40 |
SkBlitter* SkChooseA8Blitter(const SkPixmap& dst, |
| 41 |
const SkMatrix& ctm, |
| 42 |
const SkPaint&, |
| 43 |
SkArenaAlloc*, |
| 44 |
SkDrawCoverage, |
| 45 |
sk_sp<SkShader> clipShader); |
| 46 |
|
| 47 |
// signature compatible with color version |
| 48 |
SkBlitter* SkA8Blitter_Choose(const SkPixmap& dst, |
| 49 |
const SkMatrix& ctm, |
| 50 |
const SkPaint& paint, |
| 51 |
SkArenaAlloc* alloc, |
| 52 |
SkDrawCoverage coverage, |
| 53 |
sk_sp<SkShader> clipShader, |
| 54 |
const SkSurfaceProps& /*ignored*/, |
| 55 |
const SkRect& /*ignored*/); |
| 56 |
|
| 57 |
#endif // SkBlitter_A8_DEFINED |