OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrDitherEffect.h" | 8 #include "GrDitherEffect.h" |
9 #include "GrFragmentProcessor.h" | 9 #include "GrFragmentProcessor.h" |
10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 }; | 46 }; |
47 | 47 |
48 void DitherEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 48 void DitherEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
49 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); | 49 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
50 } | 50 } |
51 | 51 |
52 ////////////////////////////////////////////////////////////////////////////// | 52 ////////////////////////////////////////////////////////////////////////////// |
53 | 53 |
54 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect); | 54 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect); |
55 | 55 |
56 const GrFragmentProcessor* DitherEffect::TestCreate(GrProcessorTestData*) { | 56 GrFragmentProcessor* DitherEffect::TestCreate(GrProcessorTestData*) { |
57 return DitherEffect::Create(); | 57 return DitherEffect::Create(); |
58 } | 58 } |
59 | 59 |
60 ////////////////////////////////////////////////////////////////////////////// | 60 ////////////////////////////////////////////////////////////////////////////// |
61 | 61 |
62 class GLDitherEffect : public GrGLFragmentProcessor { | 62 class GLDitherEffect : public GrGLFragmentProcessor { |
63 public: | 63 public: |
64 GLDitherEffect(const GrProcessor&); | 64 GLDitherEffect(const GrProcessor&); |
65 | 65 |
66 virtual void emitCode(EmitArgs& args) override; | 66 virtual void emitCode(EmitArgs& args) override; |
(...skipping 28 matching lines...) Expand all Loading... |
95 void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, | 95 void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, |
96 GrProcessorKeyBuilder* b) const { | 96 GrProcessorKeyBuilder* b) const { |
97 GLDitherEffect::GenKey(*this, caps, b); | 97 GLDitherEffect::GenKey(*this, caps, b); |
98 } | 98 } |
99 | 99 |
100 GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const { | 100 GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const { |
101 return new GLDitherEffect(*this); | 101 return new GLDitherEffect(*this); |
102 } | 102 } |
103 | 103 |
104 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); } | 104 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); } |
OLD | NEW |