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

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

Issue 319543007: one channel texture fix for blur shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 void OutputRectBlurProfileLookup(GrGLShaderBuilder* builder, 627 void OutputRectBlurProfileLookup(GrGLShaderBuilder* builder,
628 const GrGLShaderBuilder::TextureSampler& sample r, 628 const GrGLShaderBuilder::TextureSampler& sample r,
629 const char *output, 629 const char *output,
630 const char *profileSize, const char *loc, 630 const char *profileSize, const char *loc,
631 const char *blurred_width, 631 const char *blurred_width,
632 const char *sharp_width) { 632 const char *sharp_width) {
633 builder->fsCodeAppendf("\t\tfloat coord = (0.5 * (abs(2*%s - %s) - %s))/%s;\ n", 633 builder->fsCodeAppendf("\t\tfloat coord = (0.5 * (abs(2*%s - %s) - %s))/%s;\ n",
634 loc, blurred_width, sharp_width, profileSize); 634 loc, blurred_width, sharp_width, profileSize);
635 builder->fsCodeAppendf("\t\t%s = ", output); 635 builder->fsCodeAppendf("\t\t%s = ", output);
636 builder->fsAppendTextureLookup(sampler, "vec2(coord,0.5)"); 636 builder->fsAppendTextureLookup(sampler, "vec2(coord,0.5)");
637 builder->fsCodeAppend(";\n"); 637 builder->fsCodeAppend(".a;\n");
638 } 638 }
639 639
640 void GrGLRectBlurEffect::emitCode(GrGLShaderBuilder* builder, 640 void GrGLRectBlurEffect::emitCode(GrGLShaderBuilder* builder,
641 const GrDrawEffect&, 641 const GrDrawEffect&,
642 EffectKey key, 642 EffectKey key,
643 const char* outputColor, 643 const char* outputColor,
644 const char* inputColor, 644 const char* inputColor,
645 const TransformedCoordsArray& coords, 645 const TransformedCoordsArray& coords,
646 const TextureSamplerArray& samplers) { 646 const TextureSamplerArray& samplers) {
647 647
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 } else { 1212 } else {
1213 str->append("None"); 1213 str->append("None");
1214 } 1214 }
1215 str->append("))"); 1215 str->append("))");
1216 } 1216 }
1217 #endif 1217 #endif
1218 1218
1219 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1219 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1220 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1220 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1221 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1221 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698