| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef _FX_SKIABLITTER_H_ | |
| 6 #define _FX_SKIABLITTER_H_ | |
| 7 //#define _SKIA_SUPPORT_ | |
| 8 #if defined(_SKIA_SUPPORT_) | |
| 9 class CFX_SkiaRenderer : public SkBlitter, public CFX_Object | |
| 10 { | |
| 11 protected: | |
| 12 int m_Alpha, | |
| 13 m_Red, // Or the complementary-color, C
yan | |
| 14 m_Green, // Magenta | |
| 15 m_Blue, // Yellow | |
| 16 m_Gray; // Black | |
| 17 FX_DWORD m_Color; // FX_ARGB or FX_CMYK | |
| 18 FX_BOOL m_bFullCover; | |
| 19 int m_ProcessFilter; | |
| 20 FX_BOOL m_bRgbByteOrder; | |
| 21 | |
| 22 FX_RECT m_ClipBox; | |
| 23 CFX_DIBitmap* m_pDevice; | |
| 24 CFX_DIBitmap* m_pOriDevice; | |
| 25 const CFX_ClipRgn* m_pClipRgn; | |
| 26 const CFX_DIBitmap* m_pClipMask; | |
| 27 | |
| 28 FX_LPBYTE m_pDestScan; | |
| 29 FX_LPBYTE m_pDestExtraAlphaScan; | |
| 30 FX_LPBYTE m_pOriScan; | |
| 31 FX_LPBYTE m_pClipScan; | |
| 32 | |
| 33 void (CFX_SkiaRenderer::*composite_span)(FX_LPBYTE,FX_LPBYTE,int,int,int
,int,FX_BYTE,int,int,int,FX_LPBYTE,FX_LPBYTE); | |
| 34 public: | |
| 35 | |
| 36 //-------------------------------------------------------------------- | |
| 37 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); | |
| 38 virtual void blitH(int x, int y, int width); | |
| 39 virtual void blitV(int x, int y, int height, SkAlpha alpha); | |
| 40 virtual void blitRect(int x, int y, int width, int height); | |
| 41 virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha l
eftAlpha, SkAlpha rightAlpha); | |
| 42 | |
| 43 /*----------------------------------------------------------------------
--------------------------------*/ | |
| 44 // A general alpha merge function (with clipping mask). Gray device. | |
| 45 void CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 46 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 47 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 48 FX_LPBYTE dest_extra_alpha_scan); | |
| 49 void CompositeSpan1bpp_1(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 50 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 51 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 52 FX_LPBYTE dest_extra_alpha_scan); | |
| 53 void CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 54 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 55 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 56 FX_LPBYTE dest_extra_alpha_scan); | |
| 57 void CompositeSpan1bpp_5(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 58 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 59 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 60 FX_LPBYTE dest_extra_alpha_scan); | |
| 61 void CompositeSpan1bpp_8(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 62 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 63 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 64 FX_LPBYTE dest_extra_alpha_scan); | |
| 65 void CompositeSpan1bpp_9(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 66 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 67 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 68 FX_LPBYTE dest_extra_alpha_scan); | |
| 69 void CompositeSpan1bpp_12(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 70 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 71 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 72 FX_LPBYTE dest_extra_alpha_scan); | |
| 73 void CompositeSpan1bpp_13(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 74 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 75 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 76 FX_LPBYTE dest_extra_alpha_scan); | |
| 77 | |
| 78 /*----------------------------------------------------------------------
----------------------------------*/ | |
| 79 | |
| 80 // A general alpha merge function (with clipping mask). Gray device. | |
| 81 void CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 82 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 83 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 84 FX_LPBYTE dest_extra_alpha_scan); | |
| 85 | |
| 86 void CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 87 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 88 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 89 FX_LPBYTE dest_extra_alpha_scan); | |
| 90 | |
| 91 void CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 92 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 93 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 94 FX_LPBYTE dest_extra_alpha_scan); | |
| 95 | |
| 96 void CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 97 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 98 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 99 FX_LPBYTE dest_extra_alpha_scan); | |
| 100 | |
| 101 void CompositeSpanGray_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 102 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 103 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 104 FX_LPBYTE dest_extra_alpha_scan); | |
| 105 | |
| 106 | |
| 107 void CompositeSpanGray_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 108 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 109 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 110 FX_LPBYTE dest_extra_alpha_scan); | |
| 111 | |
| 112 void CompositeSpanGray_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 113 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 114 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 115 FX_LPBYTE dest_extra_alpha_scan); | |
| 116 | |
| 117 void CompositeSpanGray_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 118 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 119 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 120 FX_LPBYTE dest_extra_alpha_scan); | |
| 121 | |
| 122 /*----------------------------------------------------------------------
----------------------------------*/ | |
| 123 void CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 124 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 125 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 126 FX_LPBYTE dest_extra_alpha_scan); | |
| 127 | |
| 128 void CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 129 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 130 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 131 FX_LPBYTE dest_extra_alpha_scan); | |
| 132 | |
| 133 | |
| 134 void CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 135 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 136 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 137 FX_LPBYTE dest_extra_alpha_scan); | |
| 138 | |
| 139 | |
| 140 void CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp
, | |
| 141 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 142 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 143 FX_LPBYTE dest_extra_alpha_scan); | |
| 144 // ... | |
| 145 /*----------------------------------------------------------------------
----------------------------------*/ | |
| 146 void CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 147 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 148 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 149 FX_LPBYTE dest_extra_alpha_scan); | |
| 150 void CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 151 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 152 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 153 FX_LPBYTE dest_extra_alpha_scan); | |
| 154 void CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 155 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 156 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 157 FX_LPBYTE dest_extra_alpha_scan); | |
| 158 void CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 159 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 160 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 161 FX_LPBYTE dest_extra_alpha_scan); | |
| 162 | |
| 163 /*----------------------------------------------------------------------
-----------------------------------*/ | |
| 164 | |
| 165 void CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 166 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 167 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 168 FX_LPBYTE dest_extra_alpha_scan); | |
| 169 void CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 170 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 171 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 172 FX_LPBYTE dest_extra_alpha_scan); | |
| 173 void CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 174 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 175 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 176 FX_LPBYTE dest_extra_alpha_scan); | |
| 177 void CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bp
p, | |
| 178 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 179 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 180 FX_LPBYTE dest_extra_alpha_scan); | |
| 181 void CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int B
pp, | |
| 182 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 183 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 184 FX_LPBYTE dest_extra_alpha_scan); | |
| 185 void CompositeSpanRGB24_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int B
pp, | |
| 186 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 187 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 188 FX_LPBYTE dest_extra_alpha_scan); | |
| 189 void CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int B
pp, | |
| 190 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 191 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 192 FX_LPBYTE dest_extra_alpha_scan); | |
| 193 void CompositeSpanRGB24_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int B
pp, | |
| 194 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 195 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 196 FX_LPBYTE dest_extra_alpha_scan); | |
| 197 | |
| 198 /*----------------------------------------------------------------------
------------------------------------*/ | |
| 199 | |
| 200 // A general alpha merge function (with clipping mask). Cmyka/Cmyk devic
e. | |
| 201 void CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp, | |
| 202 int span_left, int span_len, int span_top, FX_BYTE cover
_scan, | |
| 203 int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | |
| 204 FX_LPBYTE dest_extra_alpha_scan); | |
| 205 | |
| 206 | |
| 207 //-------------------------------------------------------------------- | |
| 208 FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_
ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder, | |
| 209 int alpha_flag = 0, void* pIccTransform = NULL); //The alpha fla
g must be fill_flag if exist. | |
| 210 }; | |
| 211 class CFX_SkiaA8Renderer : public SkBlitter, public CFX_Object | |
| 212 { | |
| 213 public: | |
| 214 //-------------------------------------------------------------------- | |
| 215 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]); | |
| 216 virtual void blitH(int x, int y, int width); | |
| 217 virtual void blitV(int x, int y, int height, SkAlpha alpha); | |
| 218 virtual void blitRect(int x, int y, int width, int height); | |
| 219 virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha l
eftAlpha, SkAlpha rightAlpha); | |
| 220 //-------------------------------------------------------------------- | |
| 221 FX_BOOL Init(CFX_DIBitmap* pDevice, int Left, int Top); | |
| 222 CFX_DIBitmap* m_pDevice; | |
| 223 int m_Left; | |
| 224 int m_Top; | |
| 225 int m_dstWidth; | |
| 226 int m_dstHeight; | |
| 227 }; | |
| 228 #endif | |
| 229 #endif | |
| OLD | NEW |