OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |