2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrDisableColorXP_DEFINED
9 #define GrDisableColorXP_DEFINED
12 #include "GrXferProcessor.h"
16 class GrDisableColorXPFactory : public GrXPFactory {
18 static GrXPFactory* Create() {
19 return SkNEW(GrDisableColorXPFactory);
22 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const SK_OVERRIDE {
26 bool canTweakAlphaForCoverage() const SK_OVERRIDE { return true; }
28 void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
29 GrXPFactory::InvariantOutput* output) const SK_OVERRIDE {
30 output->fBlendedColorFlags = 0;
31 output->fWillBlendWithDst = 0;
35 GrDisableColorXPFactory();
37 GrXferProcessor* onCreateXferProcessor(const GrDrawTargetCaps& caps,
38 const GrProcOptInfo& colorPOI,
39 const GrProcOptInfo& coveragePOI,
40 const GrDeviceCoordTexture* dstCopy) const SK_OVERRIDE;
42 bool willReadDstColor(const GrDrawTargetCaps& caps,
43 const GrProcOptInfo& colorPOI,
44 const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
48 bool onIsEqual(const GrXPFactory& xpfBase) const SK_OVERRIDE {
52 GR_DECLARE_XP_FACTORY_TEST;
54 typedef GrXPFactory INHERITED;