blob: b9e645c7cb58b86802b6bd321d5dce7556d44c30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef SkXfermode_proccoeff_DEFINED
#define SkXfermode_proccoeff_DEFINED
#include "SkXfermode.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
struct ProcCoeff {
SkXfermodeProc fProc;
SkXfermode::Coeff fSC;
SkXfermode::Coeff fDC;
};
#define CANNOT_USE_COEFF SkXfermode::Coeff(-1)
class SkProcCoeffXfermode : public SkProcXfermode {
public:
static SkProcCoeffXfermode* Create(const ProcCoeff& rec, Mode mode) {
return SkNEW_ARGS(SkProcCoeffXfermode, (rec, mode));
}
virtual bool asMode(Mode* mode) const SK_OVERRIDE;
virtual bool asCoeff(Coeff* sc, Coeff* dc) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool asNewEffect(GrEffectRef** effect,
GrTexture* background) const SK_OVERRIDE;
#endif
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)
protected:
SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode)
: INHERITED(rec.fProc) {
fMode = mode;
// these may be valid, or may be CANNOT_USE_COEFF
fSrcCoeff = rec.fSC;
fDstCoeff = rec.fDC;
}
SkProcCoeffXfermode(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
Mode getMode() const {
return fMode;
}
private:
Mode fMode;
Coeff fSrcCoeff, fDstCoeff;
typedef SkProcXfermode INHERITED;
};
#endif // #ifndef SkXfermode_proccoeff_DEFINED
|