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 26 class SkA8_Coverage_Blitter : public SkBlitter { 27 public: 28 SkA8_Coverage_Blitter(const SkPixmap& device, const SkPaint& paint); 29 void blitH(int x, int y, int width) override; 30 void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) override; 31 void blitV(int x, int y, int height, SkAlpha alpha) override; 32 void blitRect(int x, int y, int width, int height) override; 33 void blitMask(const SkMask&, const SkIRect&) override; 34 35 private: 36 const SkPixmap fDevice; 37 }; 38 39 SkBlitter* SkA8Blitter_Choose(const SkPixmap& dst, 40 const SkMatrix& ctm, 41 const SkPaint& paint, 42 SkArenaAlloc*, 43 bool drawCoverage, 44 sk_sp<SkShader> clipShader, 45 const SkSurfaceProps&); 46 47 #endif // SkBlitter_A8_DEFINED 48