Chromium Code Reviews| Index: src/gpu/effects/GrDisableColorXP.cpp |
| diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..76fdc19d0ec3140476ba44b80de5d4dece31b6eb |
| --- /dev/null |
| +++ b/src/gpu/effects/GrDisableColorXP.cpp |
| @@ -0,0 +1,66 @@ |
| +/* |
| + * Copyright 2014 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#include "effects/GrDisableColorXP.h" |
| +#include "GrProcessor.h" |
| +#include "gl/GrGLXferProcessor.h" |
| + |
| +class GrGLDisableColorXP : public GrGLXferProcessor { |
| +public: |
| + GrGLDisableColorXP(const GrProcessor&) {} |
| + |
| + ~GrGLDisableColorXP() SK_OVERRIDE {} |
| + |
| + void emitCode(const EmitArgs& args) SK_OVERRIDE {} |
| + |
| + void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {} |
| + |
| + static void GenKey(const GrProcessor&, const GrGLCaps&, |
|
bsalomon
2014/12/19 16:40:34
one line?
|
| + GrProcessorKeyBuilder*) {} |
| + |
| +private: |
| + typedef GrGLXferProcessor INHERITED; |
| +}; |
| + |
| +/////////////////////////////////////////////////////////////////////////////// |
| + |
| +GrDisableColorXP::GrDisableColorXP() { |
| + this->initClassID<GrDisableColorXP>(); |
| +} |
| + |
| +void GrDisableColorXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const { |
| + GrGLDisableColorXP::GenKey(*this, caps, b); |
| +} |
| + |
| +GrGLXferProcessor* GrDisableColorXP::createGLInstance() const { |
| + return SkNEW_ARGS(GrGLDisableColorXP, (*this)); |
| +} |
| + |
| +void GrDisableColorXP::getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const { |
| + blendInfo->fWriteColor = false; |
| +} |
| + |
| +/////////////////////////////////////////////////////////////////////////////// |
| + |
| +GrDisableColorXPFactory::GrDisableColorXPFactory() { |
| + this->initClassID<GrDisableColorXPFactory>(); |
| +} |
| + |
| +GrXferProcessor* GrDisableColorXPFactory::createXferProcessor(const GrProcOptInfo& /*colorPOI*/, |
|
bsalomon
2014/12/19 16:40:34
that named unused param warning only happens in he
|
| + const GrProcOptInfo& /*covPOI*/) const { |
| + return GrDisableColorXP::Create(); |
| +} |
| + |
| +GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); |
| + |
| +GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random, |
| + GrContext*, |
| + const GrDrawTargetCaps&, |
| + GrTexture*[]) { |
| + return GrDisableColorXPFactory::Create(); |
| +} |
| + |