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

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

Issue 648463003: FPs now use the correct builder types(just a rename) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 class GLProcessor : public GrGLFragmentProcessor { 76 class GLProcessor : public GrGLFragmentProcessor {
77 public: 77 public:
78 GLProcessor(const GrBackendProcessorFactory& factory, 78 GLProcessor(const GrBackendProcessorFactory& factory,
79 const GrProcessor&) 79 const GrProcessor&)
80 : INHERITED(factory) { 80 : INHERITED(factory) {
81 } 81 }
82 82
83 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu ilder* b) {} 83 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu ilder* b) {}
84 84
85 virtual void emitCode(GrGLProgramBuilder* builder, 85 virtual void emitCode(GrGLFPBuilder* builder,
86 const GrFragmentProcessor&, 86 const GrFragmentProcessor&,
87 const GrProcessorKey&, 87 const GrProcessorKey&,
88 const char* outputColor, 88 const char* outputColor,
89 const char* inputColor, 89 const char* inputColor,
90 const TransformedCoordsArray&, 90 const TransformedCoordsArray&,
91 const TextureSamplerArray&) SK_OVERRIDE { 91 const TextureSamplerArray&) SK_OVERRIDE {
92 if (NULL == inputColor) { 92 if (NULL == inputColor) {
93 inputColor = "vec4(1)"; 93 inputColor = "vec4(1)";
94 } 94 }
95 95
96 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui lder(); 96 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder ();
97 fsBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb) ;\n", 97 fsBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb) ;\n",
98 SK_ITU_BT709_LUM_COEFF_R, 98 SK_ITU_BT709_LUM_COEFF_R,
99 SK_ITU_BT709_LUM_COEFF_G, 99 SK_ITU_BT709_LUM_COEFF_G,
100 SK_ITU_BT709_LUM_COEFF_B, 100 SK_ITU_BT709_LUM_COEFF_B,
101 inputColor); 101 inputColor);
102 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n", 102 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n",
103 outputColor); 103 outputColor);
104 104
105 } 105 }
106 106
(...skipping 11 matching lines...) Expand all
118 inout->fColor = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(inout->fColor)); 118 inout->fColor = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(inout->fColor));
119 inout->fValidFlags = kRGB_GrColorComponentFlags; 119 inout->fValidFlags = kRGB_GrColorComponentFlags;
120 inout->fIsSingleComponent = false; 120 inout->fIsSingleComponent = false;
121 } 121 }
122 }; 122 };
123 123
124 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { 124 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const {
125 return LumaColorFilterEffect::Create(); 125 return LumaColorFilterEffect::Create();
126 } 126 }
127 #endif 127 #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