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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
92 92
93 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder (); 93 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder() ;
94 fsBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb) ;\n", 94 fsBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb) ;\n",
95 SK_ITU_BT709_LUM_COEFF_R, 95 SK_ITU_BT709_LUM_COEFF_R,
96 SK_ITU_BT709_LUM_COEFF_G, 96 SK_ITU_BT709_LUM_COEFF_G,
97 SK_ITU_BT709_LUM_COEFF_B, 97 SK_ITU_BT709_LUM_COEFF_B,
98 inputColor); 98 inputColor);
99 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n", 99 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n",
100 outputColor); 100 outputColor);
101 101
102 } 102 }
103 103
(...skipping 21 matching lines...) Expand all
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