1 /* 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 14 class GrProcOptInfo; 15 16 class GrDisableColorXPFactory : public GrXPFactory { 17 public: 18 static GrXPFactory* Create() { return new GrDisableColorXPFactory; } 19 20 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, 21 GrXPFactory::InvariantBlendedColor* blendedColor) const override { 22 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; 23 blendedColor->fWillBlendWithDst = false; 24 } 25 26 private: 27 GrDisableColorXPFactory(); 28 29 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, 30 const GrPipelineOptimizations& optimizations, 31 bool hasMixedSamples, 32 const DstTexture* dstTexture) const override; 33 34 bool onWillReadDstColor(const GrCaps& caps, 35 const GrPipelineOptimizations& optimizations, 36 bool hasMixedSamples) const override { 37 return false; 38 } 39 40 bool onIsEqual(const GrXPFactory& xpfBase) const override { 41 return true; 42 } 43 44 GR_DECLARE_XP_FACTORY_TEST; 45 46 typedef GrXPFactory INHERITED; 47 }; 48 49 #endif 50 51