| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2015 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 GrExtractAlphaFragmentProcessor_DEFINED | |
| 9 #define GrExtractAlphaFragmentProcessor_DEFINED | |
| 10 | |
| 11 #include "GrFragmentProcessor.h" | |
| 12 | |
| 13 /** This processor extracts the incoming color's alpha, ignores r, g, and b, and
feeds | |
| 14 the replicated alpha to it's inner processor. */ | |
| 15 class GrExtractAlphaFragmentProcessor : public GrFragmentProcessor { | |
| 16 public: | |
| 17 static GrFragmentProcessor* Create(const GrFragmentProcessor* processor) { | |
| 18 if (!processor) { | |
| 19 return nullptr; | |
| 20 } | |
| 21 return SkNEW_ARGS(GrExtractAlphaFragmentProcessor, (processor)); | |
| 22 } | |
| 23 | |
| 24 ~GrExtractAlphaFragmentProcessor() override {} | |
| 25 | |
| 26 const char* name() const override { return "Extract Alpha"; } | |
| 27 | |
| 28 private: | |
| 29 GrExtractAlphaFragmentProcessor(const GrFragmentProcessor* processor) { | |
| 30 this->initClassID<GrExtractAlphaFragmentProcessor>(); | |
| 31 this->registerChildProcessor(processor); | |
| 32 } | |
| 33 | |
| 34 GrGLFragmentProcessor* onCreateGLInstance() const override; | |
| 35 | |
| 36 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov
erride; | |
| 37 | |
| 38 bool onIsEqual(const GrFragmentProcessor&) const override; | |
| 39 | |
| 40 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | |
| 41 | |
| 42 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | |
| 43 | |
| 44 typedef GrFragmentProcessor INHERITED; | |
| 45 }; | |
| 46 | |
| 47 #endif | |
| OLD | NEW |