Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: src/effects/SkLumaColorFilter.cpp

Issue 1109863004: Use GLSLCaps for creating processor keys and GLSL-specific programs (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkLumaColorFilter.h" 8 #include "SkLumaColorFilter.h"
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #if SK_SUPPORT_GPU 58 #if SK_SUPPORT_GPU
59 class LumaColorFilterEffect : public GrFragmentProcessor { 59 class LumaColorFilterEffect : public GrFragmentProcessor {
60 public: 60 public:
61 static GrFragmentProcessor* Create() { 61 static GrFragmentProcessor* Create() {
62 GR_CREATE_STATIC_PROCESSOR(gLumaEffect, LumaColorFilterEffect, ()); 62 GR_CREATE_STATIC_PROCESSOR(gLumaEffect, LumaColorFilterEffect, ());
63 return SkRef(gLumaEffect); 63 return SkRef(gLumaEffect);
64 } 64 }
65 65
66 const char* name() const override { return "Luminance-to-Alpha"; } 66 const char* name() const override { return "Luminance-to-Alpha"; }
67 67
68 virtual void getGLProcessorKey(const GrGLCaps& caps, 68 virtual void getGLProcessorKey(const GrGLSLCaps& caps,
69 GrProcessorKeyBuilder* b) const override { 69 GrProcessorKeyBuilder* b) const override {
70 GLProcessor::GenKey(*this, caps, b); 70 GLProcessor::GenKey(*this, caps, b);
71 } 71 }
72 72
73 GrGLFragmentProcessor* createGLInstance() const override { 73 GrGLFragmentProcessor* createGLInstance() const override {
74 return SkNEW_ARGS(GLProcessor, (*this)); 74 return SkNEW_ARGS(GLProcessor, (*this));
75 } 75 }
76 76
77 class GLProcessor : public GrGLFragmentProcessor { 77 class GLProcessor : public GrGLFragmentProcessor {
78 public: 78 public:
79 GLProcessor(const GrProcessor&) {} 79 GLProcessor(const GrProcessor&) {}
80 80
81 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu ilder* b) {} 81 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKey Builder* b) {}
82 82
83 virtual void emitCode(GrGLFPBuilder* builder, 83 virtual void emitCode(GrGLFPBuilder* builder,
84 const GrFragmentProcessor&, 84 const GrFragmentProcessor&,
85 const char* outputColor, 85 const char* outputColor,
86 const char* inputColor, 86 const char* inputColor,
87 const TransformedCoordsArray&, 87 const TransformedCoordsArray&,
88 const TextureSamplerArray&) override { 88 const TextureSamplerArray&) override {
89 if (NULL == inputColor) { 89 if (NULL == inputColor) {
90 inputColor = "vec4(1)"; 90 inputColor = "vec4(1)";
91 } 91 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 GrFragmentProcessor* frag = LumaColorFilterEffect::Create(); 125 GrFragmentProcessor* frag = LumaColorFilterEffect::Create();
126 if (frag) { 126 if (frag) {
127 if (array) { 127 if (array) {
128 *array->append() = frag; 128 *array->append() = frag;
129 } 129 }
130 return true; 130 return true;
131 } 131 }
132 return false; 132 return false;
133 } 133 }
134 #endif 134 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698