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

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

Issue 812063002: Change to create device coord coordset (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-off-context
Patch Set: ignoring bleed Created 6 years 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/core/SkImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.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 /* 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 const SkRect& getRect() const { return fRect; } 643 const SkRect& getRect() const { return fRect; }
644 float getSigma() const { return fSigma; } 644 float getSigma() const { return fSigma; }
645 645
646 private: 646 private:
647 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile); 647 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile);
648 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; 648 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
649 649
650 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE; 650 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE;
651 651
652 static bool CreateBlurProfileTexture(GrContext *context, float sigma, 652 static bool CreateBlurProfileTexture(GrContext *context, float sigma,
653 GrTexture **blurProfileTexture); 653 GrTexture **blurProfileTexture);
654 654
655 SkRect fRect; 655 SkRect fRect;
656 float fSigma; 656 float fSigma;
657 GrTextureAccess fBlurProfileAccess; 657 GrTextureAccess fBlurProfileAccess;
658 658
659 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 659 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
660 660
661 typedef GrFragmentProcessor INHERITED; 661 typedef GrFragmentProcessor INHERITED;
662 }; 662 };
663 663
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 void GrGLRectBlurEffect::setData(const GrGLProgramDataManager& pdman, 746 void GrGLRectBlurEffect::setData(const GrGLProgramDataManager& pdman,
747 const GrProcessor& proc) { 747 const GrProcessor& proc) {
748 const GrRectBlurEffect& rbe = proc.cast<GrRectBlurEffect>(); 748 const GrRectBlurEffect& rbe = proc.cast<GrRectBlurEffect>();
749 SkRect rect = rbe.getRect(); 749 SkRect rect = rbe.getRect();
750 750
751 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot tom); 751 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot tom);
752 pdman.set1f(fProfileSizeUniform, SkScalarCeilToScalar(6*rbe.getSigma())); 752 pdman.set1f(fProfileSizeUniform, SkScalarCeilToScalar(6*rbe.getSigma()));
753 } 753 }
754 754
755 bool GrRectBlurEffect::CreateBlurProfileTexture(GrContext *context, float sigma, 755 bool GrRectBlurEffect::CreateBlurProfileTexture(GrContext *context, float sigma,
756 GrTexture **blurProfileTexture) { 756 GrTexture **blurProfileTexture) {
757 GrTextureParams params; 757 GrTextureParams params;
758 GrSurfaceDesc texDesc; 758 GrSurfaceDesc texDesc;
759 759
760 unsigned int profile_size = SkScalarCeilToInt(6*sigma); 760 unsigned int profile_size = SkScalarCeilToInt(6*sigma);
761 761
762 texDesc.fWidth = profile_size; 762 texDesc.fWidth = profile_size;
763 texDesc.fHeight = 1; 763 texDesc.fHeight = 1;
764 texDesc.fConfig = kAlpha_8_GrPixelConfig; 764 texDesc.fConfig = kAlpha_8_GrPixelConfig;
765 765
766 static const GrCacheID::Domain gBlurProfileDomain = GrCacheID::GenerateDomai n(); 766 static const GrCacheID::Domain gBlurProfileDomain = GrCacheID::GenerateDomai n();
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } else { 1269 } else {
1270 str->append("None"); 1270 str->append("None");
1271 } 1271 }
1272 str->append("))"); 1272 str->append("))");
1273 } 1273 }
1274 #endif 1274 #endif
1275 1275
1276 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1277 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1277 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698