blob: 21e69327f6555ea86b379906aa959407da4e14b2 [file] [log] [blame]
egdaniel080e6732014-12-22 07:35:52 -08001/*
2 * Copyright 2014 Google Inc.
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 GrDisableColorXP_DEFINED
9#define GrDisableColorXP_DEFINED
10
11#include "GrTypes.h"
12#include "GrXferProcessor.h"
13
14class GrProcOptInfo;
15
egdaniel080e6732014-12-22 07:35:52 -080016class GrDisableColorXPFactory : public GrXPFactory {
17public:
halcanary385fe4d2015-08-26 13:07:48 -070018 static GrXPFactory* Create() { return new GrDisableColorXPFactory; }
egdaniel080e6732014-12-22 07:35:52 -080019
cdalton1fa45722015-06-02 10:43:39 -070020 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
21 GrXPFactory::InvariantBlendedColor* blendedColor) const override {
22 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
23 blendedColor->fWillBlendWithDst = false;
egdaniel080e6732014-12-22 07:35:52 -080024 }
25
egdaniel080e6732014-12-22 07:35:52 -080026private:
27 GrDisableColorXPFactory();
28
bsalomon4b91f762015-05-19 09:29:46 -070029 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
ethannicholasde4166a2015-11-30 08:57:38 -080030 const GrPipelineOptimizations& optimizations,
cdalton86ae0a92015-06-08 15:11:04 -070031 bool hasMixedSamples,
bsalomon6a44c6a2015-05-26 09:49:05 -070032 const DstTexture* dstTexture) const override;
bsalomon50785a32015-02-06 07:02:37 -080033
ethannicholas22793252016-01-30 09:59:10 -080034 bool onWillReadDstColor(const GrCaps& caps,
35 const GrPipelineOptimizations& optimizations,
36 bool hasMixedSamples) const override {
egdaniele36914c2015-02-13 09:00:33 -080037 return false;
38 }
bsalomon50785a32015-02-06 07:02:37 -080039
mtklein36352bf2015-03-25 18:17:31 -070040 bool onIsEqual(const GrXPFactory& xpfBase) const override {
egdaniel080e6732014-12-22 07:35:52 -080041 return true;
42 }
43
44 GR_DECLARE_XP_FACTORY_TEST;
45
46 typedef GrXPFactory INHERITED;
47};
48
49#endif
50