blob: 9bbe24d757c10f0d0a313e7485afa95dfbaea50f (
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
|
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrDisableColorXP_DEFINED
#define GrDisableColorXP_DEFINED
#include "GrTypes.h"
#include "GrXferProcessor.h"
class GrProcOptInfo;
class GrDisableColorXPFactory : public GrXPFactory {
public:
static GrXPFactory* Create() {
return SkNEW(GrDisableColorXPFactory);
}
bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const override {
return true;
}
bool canTweakAlphaForCoverage() const override { return true; }
void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
GrXPFactory::InvariantOutput* output) const override {
output->fBlendedColorFlags = 0;
output->fWillBlendWithDst = 0;
}
private:
GrDisableColorXPFactory();
GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
const GrDeviceCoordTexture* dstCopy) const override;
bool willReadDstColor(const GrDrawTargetCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI) const override {
return false;
}
bool onIsEqual(const GrXPFactory& xpfBase) const override {
return true;
}
GR_DECLARE_XP_FACTORY_TEST;
typedef GrXPFactory INHERITED;
};
#endif
|