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" |
11 #include "SkRect.h" | 11 #include "SkRect.h" |
12 #include "gl/GrGLProcessor.h" | 12 #include "gl/GrGLProcessor.h" |
13 #include "gl/GrGLSL.h" | |
14 #include "gl/builders/GrGLProgramBuilder.h" | 13 #include "gl/builders/GrGLProgramBuilder.h" |
15 | 14 |
16 ////////////////////////////////////////////////////////////////////////////// | 15 ////////////////////////////////////////////////////////////////////////////// |
17 | 16 |
18 class DitherEffect : public GrFragmentProcessor { | 17 class DitherEffect : public GrFragmentProcessor { |
19 public: | 18 public: |
20 static GrFragmentProcessor* Create() { | 19 static GrFragmentProcessor* Create() { |
21 GR_CREATE_STATIC_PROCESSOR(gDitherEffect, DitherEffect, ()) | 20 GR_CREATE_STATIC_PROCESSOR(gDitherEffect, DitherEffect, ()) |
22 return SkRef(gDitherEffect); | 21 return SkRef(gDitherEffect); |
23 } | 22 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 void DitherEffect::getGLProcessorKey(const GrGLSLCaps& caps, | 108 void DitherEffect::getGLProcessorKey(const GrGLSLCaps& caps, |
110 GrProcessorKeyBuilder* b) const { | 109 GrProcessorKeyBuilder* b) const { |
111 GLDitherEffect::GenKey(*this, caps, b); | 110 GLDitherEffect::GenKey(*this, caps, b); |
112 } | 111 } |
113 | 112 |
114 GrGLFragmentProcessor* DitherEffect::createGLInstance() const { | 113 GrGLFragmentProcessor* DitherEffect::createGLInstance() const { |
115 return SkNEW_ARGS(GLDitherEffect, (*this)); | 114 return SkNEW_ARGS(GLDitherEffect, (*this)); |
116 } | 115 } |
117 | 116 |
118 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); } | 117 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); } |
OLD | NEW |