OLD | NEW |
(Empty) | |
| 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 #include "effects/GrDisableColorXP.h" |
| 9 #include "GrProcessor.h" |
| 10 #include "gl/GrGLXferProcessor.h" |
| 11 |
| 12 class GrGLDisableColorXP : public GrGLXferProcessor { |
| 13 public: |
| 14 GrGLDisableColorXP(const GrProcessor&) {} |
| 15 |
| 16 ~GrGLDisableColorXP() SK_OVERRIDE {} |
| 17 |
| 18 void emitCode(const EmitArgs& args) SK_OVERRIDE {} |
| 19 |
| 20 void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERR
IDE {} |
| 21 |
| 22 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde
r*) {} |
| 23 |
| 24 private: |
| 25 typedef GrGLXferProcessor INHERITED; |
| 26 }; |
| 27 |
| 28 /////////////////////////////////////////////////////////////////////////////// |
| 29 |
| 30 GrDisableColorXP::GrDisableColorXP() { |
| 31 this->initClassID<GrDisableColorXP>(); |
| 32 } |
| 33 |
| 34 void GrDisableColorXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBui
lder* b) const { |
| 35 GrGLDisableColorXP::GenKey(*this, caps, b); |
| 36 } |
| 37 |
| 38 GrGLXferProcessor* GrDisableColorXP::createGLInstance() const { |
| 39 return SkNEW_ARGS(GrGLDisableColorXP, (*this)); |
| 40 } |
| 41 |
| 42 void GrDisableColorXP::getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const
{ |
| 43 blendInfo->fWriteColor = false; |
| 44 } |
| 45 |
| 46 /////////////////////////////////////////////////////////////////////////////// |
| 47 |
| 48 GrDisableColorXPFactory::GrDisableColorXPFactory() { |
| 49 this->initClassID<GrDisableColorXPFactory>(); |
| 50 } |
| 51 |
| 52 GrXferProcessor* GrDisableColorXPFactory::createXferProcessor(const GrProcOptInf
o& colorPOI, |
| 53 const GrProcOptInf
o& covPOI) const { |
| 54 return GrDisableColorXP::Create(); |
| 55 } |
| 56 |
| 57 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); |
| 58 |
| 59 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random, |
| 60 GrContext*, |
| 61 const GrDrawTargetCaps&, |
| 62 GrTexture*[]) { |
| 63 return GrDisableColorXPFactory::Create(); |
| 64 } |
| 65 |
OLD | NEW |